signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SVR { /** * Sequential minimal optimization . */ private boolean smo ( double epsgr ) { } }
SupportVector i = svmax ; int ii = gmaxindex ; double old_alpha_i = i . alpha [ ii ] ; if ( i . kcache == null ) { gram ( i ) ; } SupportVector j = svmin ; int jj = gminindex ; double old_alpha_j = j . alpha [ jj ] ; // Second order working set selection . double best = 0.0 ; double gi = ii == 0 ? - i . g [ 0 ] : i . g...
public class CollationRootElements { /** * Returns the last root CE with a primary weight before p . * Intended only for reordering group boundaries . */ long lastCEWithPrimaryBefore ( long p ) { } }
if ( p == 0 ) { return 0 ; } assert ( p > elements [ ( int ) elements [ IX_FIRST_PRIMARY_INDEX ] ] ) ; int index = findP ( p ) ; long q = elements [ index ] ; long secTer ; if ( p == ( q & 0xffffff00L ) ) { // p = = elements [ index ] is a root primary . Find the CE before it . // We must not be in a primary range . as...
public class JScoreElementAbstract { /** * Add decoration if it hasn ' t been added previously */ protected void addDecoration ( JDecoration decoration ) { } }
if ( m_jDecorations == null ) { m_jDecorations = new Vector ( ) ; } if ( ! m_jDecorations . contains ( decoration ) ) { decoration . setStaffLine ( getStaffLine ( ) ) ; m_jDecorations . add ( decoration ) ; }
public class StoreFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public ServiceSimpleType createServiceSimpleTypeFromString ( EDataType eDataType , String initialValue ) { } }
ServiceSimpleType result = ServiceSimpleType . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class ThreadsParser { /** * A variation of nextElement that verifies the nextElement is not in a different namespace . * @ param reader the XmlExtendedReader to read from . * @ param expectedNamespace the namespace expected . * @ return the element or null if the end is reached * @ throws XMLStreamExcept...
Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( element == null ) { return element ; } else if ( expectedNamespace . equals ( reader . getNamespaceURI ( ) ) ) { return element ; } throw unexpectedElement ( reader ) ;
public class CmsJspTagContentLoop { /** * Initializes this content loop tag . < p > * @ param container the parent content container that provides the content element to loop */ protected void init ( I_CmsXmlContentContainer container ) { } }
m_container = container ; // append to parent element name ( required for nested schemas ) m_element = CmsXmlUtils . concatXpath ( m_container . getXmlDocumentElement ( ) , m_element ) ; // get loaded content from parent < contentload > tag m_content = m_container . getXmlDocument ( ) ; m_locale = m_container . getXmlD...
public class ScoreTemplate { /** * Sets the size associated to an attribute * @ param unit { @ link SizeUnit # PX } , { @ link SizeUnit # STAFF _ HEIGHT } . . . * @ throws RuntimeException if attribute doesn ' t accept size value */ public void setAttributeSize ( ScoreAttribute sa , float size , SizeUnit unit ) { }...
if ( ! ( sa . getDefaultValue ( ) instanceof ScoreAttribute . Size ) ) throw new RuntimeException ( sa . toString ( ) + " is not a size attribute" ) ; m_attributes . put ( sa . getName ( ) , new ScoreAttribute . Size ( size , unit ) ) ; notifyListeners ( ) ;
public class GVRRenderData { /** * Set the draw mode for this mesh . Default is GL _ TRIANGLES . * @ param drawMode */ public GVRRenderData setDrawMode ( int drawMode ) { } }
if ( drawMode != GL_POINTS && drawMode != GL_LINES && drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP && drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP && drawMode != GL_TRIANGLE_FAN ) { throw new IllegalArgumentException ( "drawMode must be one of GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_T...
public class Delete { /** * First it is checked if the user has access to delete the eFaps object * defined in { @ link # instance } . If no access , an exception is thrown . If * the context user has access . the delete is made with * { @ link # executeWithoutAccessCheck } . * @ throws EFapsException if the cu...
AccessCache . registerUpdate ( getInstance ( ) ) ; final boolean hasAccess = this . instance . getType ( ) . hasAccess ( this . instance , AccessTypeEnums . DELETE . getAccessType ( ) ) ; if ( ! hasAccess ) { throw new EFapsException ( getClass ( ) , "execute.NoAccess" , this . instance ) ; } executeWithoutAccessCheck ...
public class Cron4jTask { protected void recordJobHistory ( TaskExecutionContext context , Cron4jJob job , Thread jobThread , LocalDateTime activationTime , OptionalThing < RunnerResult > runnerResult , OptionalThing < LocalDateTime > endTime , OptionalThing < Throwable > controllerCause ) { } }
final TaskExecutor taskExecutor = context . getTaskExecutor ( ) ; final Cron4jJobHistory jobHistory = prepareJobHistory ( job , activationTime , runnerResult , endTime , controllerCause ) ; final int historyLimit = getHistoryLimit ( ) ; jobRunner . getHistoryHook ( ) . ifPresent ( hook -> { final Method hookMethod = fi...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcReinforcingElement ( ) { } }
if ( ifcReinforcingElementEClass == null ) { ifcReinforcingElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 435 ) ; } return ifcReinforcingElementEClass ;
public class StringsCompleter2 { /** * Add all strings to existing candidates . */ public void addAll ( final Iterable < String > strings ) { } }
checkNotNull ( strings ) ; for ( String string : strings ) { add ( string ) ; }
public class WDialog { /** * Override handleRequest in order to perform processing specific to this component . * @ param request the request being responded to . */ @ Override public void handleRequest ( final Request request ) { } }
// Can only be an active DIALOG if it is AJAX targetted . if ( isAjaxTargeted ( ) ) { if ( getState ( ) == INACTIVE_STATE ) { handleTriggerOpenAction ( request ) ; } getOrCreateComponentModel ( ) . state = ACTIVE_STATE ; } else if ( getState ( ) != INACTIVE_STATE ) { getOrCreateComponentModel ( ) . state = INACTIVE_STA...
public class MalisisCommand { /** * Processes the command . * @ param sender the sender * @ param params the params */ @ Override public void execute ( MinecraftServer server , ICommandSender sender , String [ ] params ) throws CommandException { } }
if ( params . length == 0 ) throw new WrongUsageException ( "malisiscore.commands.usage" ) ; if ( ! parameters . contains ( params [ 0 ] ) ) throw new WrongUsageException ( "malisiscore.commands.usage" ) ; switch ( params [ 0 ] ) { case "config" : configCommand ( sender , params ) ; break ; case "version" : IMalisisMod...
public class BigtableAsyncAdmin { /** * < p > modifyColumns . < / p > * @ param modifications a { @ link ModifyTableBuilder } object . */ private CompletableFuture < Void > modifyColumns ( ModifyTableBuilder modifications ) { } }
return toCompletableFuture ( bigtableTableAdminClient . modifyFamiliesAsync ( modifications . build ( ) ) ) . thenApply ( r -> null ) ;
public class Statement { /** * Sets the values value for this Statement . * @ param values * Holds keys and values for bind variables and their values . * The key is the * name of the bind variable . The value is the literal * value of the variable . * In the example { @ code " WHERE status = : bindStatus *...
this . values = values ;
public class LessParser { /** * Parse and handle an < code > @ import < / code > directive . * @ param currentRule current container . This can be the root or a rule . * @ param name the content of the directive like a file name and keywords * @ throws LessException if any parsing error occurred */ private void i...
String filename = name . trim ( ) ; boolean isReference = reader . isReference ( ) ; boolean isCss = false ; boolean isLess = false ; boolean isMultiple = reader . isMultiple ( ) ; boolean isInline = false ; boolean isOptional = false ; if ( filename . startsWith ( "(" ) ) { int endIdx = filename . indexOf ( ')' , 1 ) ...
public class QueueContainer { /** * Returns data in the queue . This method triggers store load . * @ return the item data in the queue . */ public List < Data > getAsDataList ( ) { } }
List < Data > dataList = new ArrayList < Data > ( getItemQueue ( ) . size ( ) ) ; for ( QueueItem item : getItemQueue ( ) ) { if ( store . isEnabled ( ) && item . getData ( ) == null ) { try { load ( item ) ; } catch ( Exception e ) { throw new HazelcastException ( e ) ; } } dataList . add ( item . getData ( ) ) ; } re...
public class FacebookRestClient { /** * Retrieves the membership list of a group * @ param groupId the group id * @ return a T containing four membership lists of * ' members ' , ' admins ' , ' officers ' , and ' not _ replied ' */ public T groups_getMembers ( Number groupId ) throws FacebookException , IOExcepti...
assert ( null != groupId ) ; return this . callMethod ( FacebookMethod . GROUPS_GET_MEMBERS , new Pair < String , CharSequence > ( "gid" , groupId . toString ( ) ) ) ;
public class XmlUtils { /** * Parse a < code > File < / code > containing an XML structure into a DOM tree . * @ param input * The input XML file . * @ return The corresponding DOM tree , or < code > null < / code > if the input could not be parsed successfully . */ public static Document parseFile ( final File i...
Document output = null ; try { final DocumentBuilder db = FACTORY . newDocumentBuilder ( ) ; db . setErrorHandler ( new ParserErrorHandler ( ) ) ; output = db . parse ( input ) ; } catch ( final Exception ex ) { String msg = "Problem parsing the input XML file" ; if ( ex instanceof SAXParseException ) { msg += " at lin...
public class CLI { /** * Main entry point of ixa - pipe - nerc . * @ param args * the arguments passed through the CLI * @ throws IOException * exception if input data not available * @ throws JDOMException * if problems with the xml formatting of NAF */ public static void main ( final String [ ] args ) thr...
CLI cmdLine = new CLI ( ) ; cmdLine . parseCLI ( args ) ;
public class CompilerOptions { /** * Create a CompilerOptions object that is appropriate for just doing a * syntax check . * @ param deprecationWarnings * determine what deprecation warnings are provided * @ return CompilerOptions object configured for a syntax check . */ public static CompilerOptions createChe...
Pattern debugNsInclude = null ; Pattern debugNsExclude = null ; int maxIteration = 5000 ; int maxRecursion = 50 ; Set < Formatter > formatters = new HashSet < Formatter > ( ) ; File outputDirectory = null ; File annotationDirectory = null ; File annotationBaseDirectory = null ; LinkedList < File > includeDirectories = ...
public class Inventory { /** * Removes the entry with the specified key . * @ param key the key * @ return returns the removed entry */ InventoryEntry remove ( String key ) { } }
InventoryEntry ret = configs . remove ( key ) ; if ( ret != null ) { ret . getPath ( ) . delete ( ) ; } return ret ;
public class Cache { /** * Returns a row if in memory cache . */ public synchronized CachedObject get ( int pos ) { } }
if ( accessCount == Integer . MAX_VALUE ) { resetAccessCount ( ) ; } int lookup = getLookup ( pos ) ; if ( lookup == - 1 ) { return null ; } accessTable [ lookup ] = accessCount ++ ; return ( CachedObject ) objectValueTable [ lookup ] ;
public class AjcHelper { /** * Based on a set of weavedirs returns a set of all the files to be weaved . * @ return * @ throws MojoExecutionException */ public static Set < String > getWeaveSourceFiles ( String [ ] weaveDirs ) throws MojoExecutionException { } }
Set < String > result = new HashSet < String > ( ) ; for ( int i = 0 ; i < weaveDirs . length ; i ++ ) { String weaveDir = weaveDirs [ i ] ; if ( FileUtils . fileExists ( weaveDir ) ) { try { result . addAll ( FileUtils . getFileNames ( new File ( weaveDir ) , "**/*.class" , DEFAULT_EXCLUDES , true ) ) ; } catch ( IOEx...
public class MultiTimingEvent { /** * End the previous stage and record the time spent in that stage . */ public void endStage ( ) { } }
if ( this . currentStage != null ) { long time = System . currentTimeMillis ( ) - this . currentStageStart ; this . timings . add ( new Stage ( this . currentStage , time ) ) ; if ( reportAsMetrics && submitter . getMetricContext ( ) . isPresent ( ) ) { String timerName = submitter . getNamespace ( ) + "." + name + "."...
public class LdiSrl { /** * Get the index of the first - found delimiter . * < pre > * indexOfFirst ( " foo . bar / baz . qux " , " . " , " / " ) * returns the index of " . bar " * < / pre > * @ param str The target string . ( NotNull ) * @ param delimiters The array of delimiters . ( NotNull ) * @ return...
return doIndexOfFirst ( false , str , delimiters ) ;
public class ServiceTools { /** * Get template from parameterizedType * @ param parameterizedType * @ return */ String getTemplateOfParameterizedType ( ParameterizedType parameterizedType , IJsonMarshaller jsonMarshaller ) { } }
Class cls = ( Class ) parameterizedType . getRawType ( ) ; Type [ ] actualTypeArguments = parameterizedType . getActualTypeArguments ( ) ; String res ; if ( Iterable . class . isAssignableFrom ( cls ) ) { res = getTemplateOfIterable ( actualTypeArguments , jsonMarshaller ) ; } else if ( Map . class . isAssignableFrom (...
public class DocumentFactory { /** * Get the document factory . * @ return The document factory . * @ throws LionEngineException If unable to create builder . */ private static synchronized DocumentBuilder getDocumentFactory ( ) { } }
if ( documentBuilder == null ) { final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; documentBuilderFactory . setIgnoringElementContentWhitespace ( true ) ; try { documentBuilderFactory . setFeature ( javax . xml . XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; } catch ...
public class ntpserver { /** * Use this API to update ntpserver . */ public static base_response update ( nitro_service client , ntpserver resource ) throws Exception { } }
ntpserver updateresource = new ntpserver ( ) ; updateresource . serverip = resource . serverip ; updateresource . servername = resource . servername ; updateresource . minpoll = resource . minpoll ; updateresource . maxpoll = resource . maxpoll ; updateresource . preferredntpserver = resource . preferredntpserver ; upd...
public class Tags { /** * Ensures that a given string is a valid metric name or tag name / value . * @ param what A human readable description of what ' s being validated . * @ param s The string to validate . * @ throws IllegalArgumentException if the string isn ' t valid . */ public static void validateString (...
if ( s == null ) { throw new IllegalArgumentException ( "Invalid " + what + ": null" ) ; } else if ( "" . equals ( s ) ) { throw new IllegalArgumentException ( "Invalid " + what + ": empty string" ) ; } final int n = s . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { final char c = s . charAt ( i ) ; if ( ! ( ( 'a' <=...
public class FDBigInt { /** * Multiply a FDBigInt by another FDBigInt . * Result is a new FDBigInt . */ public FDBigInt mult ( FDBigInt other ) { } }
// crudely guess adequate size for r int r [ ] = new int [ nWords + other . nWords ] ; int i ; // I think I am promised zeros . . . for ( i = 0 ; i < this . nWords ; i ++ ) { long v = ( long ) this . data [ i ] & 0xffffffffL ; // UNSIGNED CONVERSION long p = 0L ; int j ; for ( j = 0 ; j < other . nWords ; j ++ ) { p +=...
public class SerializerIntrinsics { /** * Bit Scan Reverse . */ public final void bsr ( Register dst , Mem src ) { } }
assert ( ! dst . isRegType ( REG_GPB ) ) ; emitX86 ( INST_BSR , dst , src ) ;
public class WhileyFileParser { /** * Check whether we have a duplicate default statement , or a case which * occurs after a default statement ( and , hence , is unreachable ) . * @ param cases */ private void checkForDuplicateDefault ( List < Stmt . Case > cases ) { } }
boolean hasDefault = false ; for ( int i = 0 ; i != cases . size ( ) ; ++ i ) { Stmt . Case c = cases . get ( i ) ; if ( c . getConditions ( ) . size ( ) > 0 && hasDefault ) { syntaxError ( "unreachable code" , c ) ; } else if ( c . getConditions ( ) . size ( ) == 0 && hasDefault ) { syntaxError ( "duplicate default la...
public class Contextualizer { /** * Contextualizes operation with contexts given by { @ link OperationalContext } * @ param retriever the context * @ param instance the instance to wrap ( must comply with given interface ) * @ param interfaze the interface of return object * @ param contextPropagatingInterfaces...
OperationalContextRetriver retriever = new OperationalContextRetriver ( ) { @ Override public OperationalContext retrieve ( ) { return context ; } } ; return contextualize ( retriever , instance , interfaze ) ;
public class LObjIntConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T > LObjIntConsumerBuilder < T > objIntConsumer ( Consumer < LObjIntConsumer < T >...
return new LObjIntConsumerBuilder ( consumer ) ;
public class DefaultHudsonClient { /** * join a base url to another path or paths - this will handle trailing or non - trailing / ' s */ public static String joinURL ( String base , String [ ] paths ) { } }
StringBuilder result = new StringBuilder ( base ) ; Arrays . stream ( paths ) . map ( path -> path . replaceFirst ( "^(\\/)+" , "" ) ) . forEach ( p -> { if ( result . lastIndexOf ( "/" ) != result . length ( ) - 1 ) { result . append ( '/' ) ; } result . append ( p ) ; } ) ; return result . toString ( ) ;
public class FFMQTopicConnectionFactory { /** * / * ( non - Javadoc ) * @ see javax . jms . TopicConnectionFactory # createTopicConnection ( ) */ @ Override public TopicConnection createTopicConnection ( ) throws JMSException { } }
String username = getStringProperty ( Context . SECURITY_PRINCIPAL , null ) ; String password = getStringProperty ( Context . SECURITY_CREDENTIALS , null ) ; return createTopicConnection ( username , password ) ;
public class UndertowServerEngineFactory { /** * This method removes the Server Engine from the port map and stops it . */ public synchronized void destroyForPort ( int port ) { } }
synchronized ( portMap ) { UndertowServerEngine ref = portMap . remove ( port ) ; if ( ref != null ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Stopping HttpServer Engine on port " + port + "." ) ; } try { ref . stop ( ) ; } catch ( Exception e ) { LOG . warn ( "" , e ) ; } } }
public class Descriptives { /** * Calculates Minimum absolute value . * @ param flatDataCollection * @ return */ public static double minAbsolute ( FlatDataCollection flatDataCollection ) { } }
double minAbs = Double . POSITIVE_INFINITY ; Iterator < Double > it = flatDataCollection . iteratorDouble ( ) ; while ( it . hasNext ( ) ) { Double v = it . next ( ) ; if ( v != null ) { minAbs = Math . min ( minAbs , Math . abs ( v ) ) ; } } return minAbs ;
public class ScriptVars { /** * Sets or removes a global variable . * The variable is removed when the { @ code value } is { @ code null } . * @ param key the key of the variable . * @ param value the value of the variable . * @ throws IllegalArgumentException if one of the following conditions is met : * < u...
validateKey ( key ) ; if ( value == null ) { globalVars . remove ( key ) ; } else { validateValueLength ( value ) ; if ( globalVars . size ( ) > MAX_GLOBAL_VARS ) { throw new IllegalArgumentException ( "Maximum number of global variables reached: " + MAX_GLOBAL_VARS ) ; } globalVars . put ( key , value ) ; }
public class BonusPaymentMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BonusPayment bonusPayment , ProtocolMarshaller protocolMarshaller ) { } }
if ( bonusPayment == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( bonusPayment . getWorkerId ( ) , WORKERID_BINDING ) ; protocolMarshaller . marshall ( bonusPayment . getBonusAmount ( ) , BONUSAMOUNT_BINDING ) ; protocolMarshaller . marsh...
public class URLConnection { /** * Returns the value of the named field parsed as date . The result is the number of milliseconds * since January 1 , 1970 GMT represented by the named field . * This form of { @ code getHeaderField } exists because some connection types ( e . g . , { @ code http - ng } * ) have pr...
final String value = this . getHeaderField ( name ) ; try { return Date . parse ( value ) ; } catch ( final Exception e ) { // NOPMD } return pdefault ;
public class CmsSetupBean { /** * Returns the URI of a database config page ( in step 3 ) for a specified database key . < p > * @ param key the database key ( e . g . " mysql " , " generic " or " oracle " ) * @ return the URI of a database config page */ public String getDatabaseConfigPage ( String key ) { } }
// don ' t use File . separatorChar here , result must be a valid URL with " / " path delimiters String configUri = FOLDER_DATABASE + key + "/" + "step_4_database_setup.jsp" ; return CmsStringUtil . substitute ( configUri , File . separator , "/" ) ;
public class AssetsInner { /** * List Streaming Locators . * Lists Streaming Locators which are associated with this asset . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param assetName The Asset name . *...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( account...
public class BusItinerary { @ Override public void revalidate ( ) { } }
// Override this function to be sure that // the invalid and valid collections // has no impact of the iteration on // the elements in this itinerary final BusItineraryHalt [ ] tabV = new BusItineraryHalt [ this . validHalts . size ( ) ] ; this . validHalts . toArray ( tabV ) ; final BusItineraryHalt [ ] tabI = new Bus...
public class SDBaseOps { /** * Equal to operation : elementwise x = = y < br > * If x and y arrays have equal shape , the output shape is the same as these inputs . < br > * Note : supports broadcasting if x and y have different shapes and are broadcastable . < br > * Returns an array with values 1 where conditio...
SDVariable result = f ( ) . eq ( x , y ) ; return updateVariableNameAndReference ( result , name ) ;
public class CPMeasurementUnitLocalServiceBaseImpl { /** * Deletes the cp measurement unit with the primary key from the database . Also notifies the appropriate model listeners . * @ param CPMeasurementUnitId the primary key of the cp measurement unit * @ return the cp measurement unit that was removed * @ throw...
return cpMeasurementUnitPersistence . remove ( CPMeasurementUnitId ) ;
public class HybridPersistenceActivator { /** * This method returns a combination of those persistence providers available from * the application classloader in addition to those in the OSGi service registry . * OSGi providers are not cached and should not be cached because bundles can * be moved in and out of th...
// try to get the context classloader first , if that fails , use the loader // that loaded this class ClassLoader cl = PrivClassLoader . get ( null ) ; if ( cl == null ) { cl = PrivClassLoader . get ( HybridPersistenceActivator . class ) ; } // Query the provider cache per - classloader List < PersistenceProvider > no...
public class WDataTableRenderer { /** * Paint the pagination aspects of the WDataTable . * @ param table the WDataTable being rendered * @ param xml the string builder in use */ private void paintPaginationElement ( final WDataTable table , final XmlStringBuilder xml ) { } }
TableDataModel model = table . getDataModel ( ) ; xml . appendTagOpen ( "ui:pagination" ) ; if ( model instanceof TreeTableDataModel ) { // For tree tables , we only include top - level nodes for pagination . TreeNode firstNode = ( ( TreeTableDataModel ) model ) . getNodeAtLine ( 0 ) ; xml . appendAttribute ( "rows" , ...
public class JdbcCpoAdapter { /** * DOCUMENT ME ! * @ param name DOCUMENT ME ! * @ param criteria DOCUMENT ME ! * @ param result DOCUMENT ME ! * @ param wheres DOCUMENT ME ! * @ param orderBy DOCUMENT ME ! * @ param con DOCUMENT ME ! * @ param useRetrieve DOCUMENT ME ! * @ throws CpoException DOCUMENT M...
Logger localLogger = criteria == null ? logger : LoggerFactory . getLogger ( criteria . getClass ( ) ) ; PreparedStatement ps = null ; List < CpoFunction > cpoFunctions ; CpoClass criteriaClass ; CpoClass resultClass ; ResultSet rs = null ; ResultSetMetaData rsmd ; int columnCount ; int k ; T obj ; JdbcCpoAttribute [ ]...
public class SequenceLabelerME { /** * Returns at most the specified number of taggings for the specified * sentence . * @ param numTaggings * the number of labels to be returned . * @ param tokens * an array of tokens which make up a sentence . * @ return at most the specified number of labels for the spec...
final Sequence [ ] bestSequences = this . model . bestSequences ( numTaggings , tokens , null , this . contextGenerator , this . sequenceValidator ) ; final Span [ ] [ ] tags = new Span [ bestSequences . length ] [ ] ; for ( int i = 0 ; i < tags . length ; i ++ ) { final List < String > c = bestSequences [ i ] . getOut...
public class ProcessControlHelper { /** * Read in the file containing the location of the java dumps and populate into a map of dump type * to file location * @ param javaDumpLocationFile the file containing the dump locations * @ return a map of java dump action and the corresponding file location or null if we ...
Map < JavaDumpAction , String > fileLocations = new EnumMap < JavaDumpAction , String > ( JavaDumpAction . class ) ; BufferedReader reader = null ; try { reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( javaDumpLocationFile ) , "UTF-8" ) ) ; for ( String line ; ( line = reader . readLine ( ) ...
public class ClassPathImpl { /** * Search list of codebases for named resource . * @ param codeBaseList * list of codebases to search * @ param resourceName * name of resourse * @ return codebase entry for the named resource , or null if the named * resource cannot be found */ private ICodeBaseEntry search ...
for ( ICodeBase codeBase : codeBaseList ) { ICodeBaseEntry resource = codeBase . lookupResource ( resourceName ) ; if ( resource != null ) { return resource ; } // Ignore , continue trying other codebases } return null ;
public class FragmentBuilder { /** * This method returns the state associated with the name and optional * context . * @ param context The optional context * @ param name The name * @ return The state , or null if not found */ public Object getState ( Object context , String name ) { } }
StateInformation si = stateInformation . get ( name ) ; if ( si == null ) { return null ; } return si . get ( context ) ;
public class DocumentSubscriptions { /** * It opens a subscription and starts pulling documents since a last processed document for that subscription . * The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client * needs to acknowledge t...
return getSubscriptionWorker ( clazz , options , null ) ;
public class ToastJsGenerator { /** * { @ inheritDoc } . */ @ Override protected Map < String , Object > initializeVariables ( final Set < StringTextValue < ? > > allSettings ) { } }
final Map < String , Object > variables = super . initializeVariables ( allSettings ) ; variables . put ( COMMAND , getCommand ( getSettings ( ) ) ) ; return variables ;
public class NetworkInputSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NetworkInputSettings networkInputSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( networkInputSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( networkInputSettings . getHlsInputSettings ( ) , HLSINPUTSETTINGS_BINDING ) ; protocolMarshaller . marshall ( networkInputSettings . getServerValidation ( ) , SERVE...
public class DisksInner { /** * Creates or updates a disk . * @ param resourceGroupName The name of the resource group . * @ param diskName The name of the managed disk that is being created . The name can ' t be changed after the disk is created . Supported characters for the name are a - z , A - Z , 0-9 and _ . T...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , diskName , disk ) . map ( new Func1 < ServiceResponse < DiskInner > , DiskInner > ( ) { @ Override public DiskInner call ( ServiceResponse < DiskInner > response ) { return response . body ( ) ; } } ) ;
public class StringUtils { /** * Count stops . * @ param str string * @ return how many stops ' . ' str contains */ public static int countStops ( String str ) { } }
int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == '.' || str . charAt ( i ) == '?' || str . charAt ( i ) == '!' ) { count ++ ; } } return count ;
public class Operation { /** * This function is used to fixup variables from QNames to stack frame * indexes at stylesheet build time . * @ param vars List of QNames that correspond to variables . This list * should be searched backwards for the first qualified name that * corresponds to the variable reference ...
m_left . fixupVariables ( vars , globalsSize ) ; m_right . fixupVariables ( vars , globalsSize ) ;
public class URIUtils { /** * Returns true if the given character is allowed . * @ param c character to check * @ param allow characters to allow * @ return true if the character is allowed or false if it should be * encoded */ private static boolean isAllowed ( char c , String allow ) { } }
return ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c >= '0' && c <= '9' ) || "_-!.~'()*" . indexOf ( c ) != NOT_FOUND || ( allow != null && allow . indexOf ( c ) != NOT_FOUND ) ;
public class MapViewerTemplate { /** * Android Activity life cycle method . * @ param savedInstanceState */ @ Override protected void onCreate ( Bundle savedInstanceState ) { } }
super . onCreate ( savedInstanceState ) ; createSharedPreferences ( ) ; createMapViews ( ) ; createTileCaches ( ) ; checkPermissionsAndCreateLayersAndControls ( ) ;
public class MathBindings { /** * Binding for { @ link java . lang . Math # exp ( double ) } * @ param a the exponent to raise < i > e < / i > to . * @ return the value < i > e < / i > < sup > { @ code a } < / sup > , * where < i > e < / i > is the base of the natural logarithms . */ public static DoubleBinding e...
return createDoubleBinding ( ( ) -> Math . exp ( a . get ( ) ) , a ) ;
public class Rapids { /** * Parse a list of strings . Strings can be either in single - or in double quotes . */ private AstStrList parseStringList ( ) { } }
ArrayList < String > strs = new ArrayList < > ( 10 ) ; while ( isQuote ( skipWS ( ) ) ) { strs . add ( string ( ) ) ; if ( skipWS ( ) == ',' ) eatChar ( ',' ) ; } return new AstStrList ( strs ) ;
public class WebAppSecurityCollaboratorImpl { /** * Notify the registered listeners of the change to the UserRegistry * configuration . */ private void notifyWebAppSecurityConfigChangeListeners ( List < String > delta ) { } }
WebAppSecurityConfigChangeEvent event = new WebAppSecurityConfigChangeEventImpl ( delta ) ; for ( WebAppSecurityConfigChangeListener listener : webAppSecurityConfigchangeListenerRef . services ( ) ) { listener . notifyWebAppSecurityConfigChanged ( event ) ; }
public class HttpHeaders { /** * @ deprecated Use { @ link # remove ( CharSequence ) } instead . * @ see # removeHeader ( HttpMessage , CharSequence ) */ @ Deprecated public static void removeHeader ( HttpMessage message , String name ) { } }
message . headers ( ) . remove ( name ) ;
public class SecretKeyBackupHelper { /** * Create a { @ link SecretkeyElement } which contains the secret keys listed in { @ code fingerprints } and is encrypted * symmetrically using the { @ code backupCode } . * @ param provider { @ link OpenPgpProvider } for symmetric encryption . * @ param owner owner of the ...
ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; for ( OpenPgpV4Fingerprint fingerprint : fingerprints ) { PGPSecretKeyRing key = provider . getStore ( ) . getSecretKeyRing ( owner , fingerprint ) ; if ( key == null ) { throw new MissingOpenPgpKeyException ( owner , fingerprint ) ; } byte [ ] bytes = key ...
public class DBUtils { /** * This method returns approapiate query clauses to be executed within a SQL * statement . * @ param params * the list of parameters - name value * @ param orderParams * the name of the parameters that will be used to sort the * result and also the sorting order . Each entry will b...
final StringBuffer queryString = new StringBuffer ( ) ; if ( ( params != null ) && ! params . isEmpty ( ) ) { queryString . append ( " where " ) ; for ( final Iterator < Map . Entry < String , Object > > it = params . entrySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { final Map . Entry < String , Object > entry = it ...
public class Controller { /** * Convenience method for { @ link # redirect ( Class , java . util . Map ) } . * @ param controllerClass controller class where to send redirect . * @ param < T > class extending { @ link Controller } * @ param action action to redirect to . * @ param id id to redirect to . * @ r...
redirect ( controllerClass , CollectionUtil . map ( "action" , action , "id" , id ) ) ;
public class ZookeeperDriverImpl { /** * 通知某个Node更新 * @ param app * @ param env * @ param version * @ param disConfigTypeEnum */ @ Override public void notifyNodeUpdate ( String app , String env , String version , String key , String value , DisConfigTypeEnum disConfigTypeEnum ) { } }
// 获取路径 String baseUrlString = ZooPathMgr . getZooBaseUrl ( zooConfig . getZookeeperUrlPrefix ( ) , app , env , version ) ; String path = "" ; if ( disConfigTypeEnum . equals ( DisConfigTypeEnum . ITEM ) ) { path = ZooPathMgr . getItemZooPath ( baseUrlString ) ; } else { path = ZooPathMgr . getFileZooPath ( baseUrlStri...
public class BigDecimalParameter { /** * Write data to socket in binary format . * @ param pos socket output stream * @ throws IOException if socket error occur */ public void writeBinary ( PacketOutputStream pos ) throws IOException { } }
String value = bigDecimal . toPlainString ( ) ; pos . writeFieldLength ( value . length ( ) ) ; pos . write ( value ) ;
public class CommercePriceListUtil { /** * Returns the last commerce price list in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * ...
return getPersistence ( ) . fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ;
public class SequenceGibbsSampler { /** * Samples a single position in the sequence . * Destructively modifies the sequence in place . * returns the score of the new sequence * @ param sequence the sequence to start with * @ param pos the position to sample . */ public double samplePosition ( SequenceModel mode...
double [ ] distribution = model . scoresOf ( sequence , pos ) ; if ( temperature != 1.0 ) { if ( temperature == 0.0 ) { // set the max to 1.0 int argmax = ArrayMath . argmax ( distribution ) ; Arrays . fill ( distribution , Double . NEGATIVE_INFINITY ) ; distribution [ argmax ] = 0.0 ; } else { // take all to a power /...
public class DirectoryLoaderAdaptor { /** * ContainsKey implementation for chunk elements */ protected Boolean containsKeyIntern ( final FileCacheKey fileCacheKey ) throws IOException { } }
for ( String file : directory . listAll ( ) ) { if ( file . equals ( fileCacheKey . getFileName ( ) ) ) { return true ; } } return false ;
public class ExtensionValidator { /** * { @ inheritDoc } */ @ Override public void validate ( ValidationHelper helper , Context context , String key , Object t ) { } }
if ( key != null ) { if ( ! key . startsWith ( "x-" ) ) { final String message = Tr . formatMessage ( tc , "invalidExtensionName" , key ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; } }
public class CollUtil { /** * 根据Bean的属性排序 * @ param < T > 元素类型 * @ param list List * @ param property 属性名 * @ return 排序后的List * @ since 4.0.6 */ public static < T > List < T > sortByProperty ( List < T > list , String property ) { } }
return sort ( list , new PropertyComparator < > ( property ) ) ;
public class HtmlEmailImpl { /** * Set the message . * This method overrides the MultiPartEmail setMsg ( ) method in order to send an HTML message instead * of a full text message in the mail body . The message is formatted in HTML for the HTML part of * the message , it is let as is in the alternate text part . ...
if ( StringUtil . isEmpty ( msg ) ) { throw new EmailException ( "Invalid message supplied" ) ; } setTextMsg ( msg ) ; setHtmlMsg ( new StringBuffer ( ) . append ( "<html><body><pre>" ) . append ( msg ) . append ( "</pre></body></html>" ) . toString ( ) ) ; return this ;
public class JMStats { /** * https : / / en . wikipedia . org / wiki / Algorithms _ for _ calculating _ variance # cite _ note - : 0-10 */ public static double calPairwiseVariance ( long count1 , double sum1 , double variance1 , long count2 , double sum2 , double variance2 ) { } }
return ( variance1 * ( count1 - 1 ) + variance2 * ( count2 - 1 ) + pow ( sum2 / count2 - sum1 / count1 , 2 ) * count1 * count2 / ( count1 + count2 ) ) / ( count1 + count2 - 1 ) ;
public class EnvironmentResourceDescription { /** * The < code > AutoScalingGroups < / code > used by this environment . * @ param autoScalingGroups * The < code > AutoScalingGroups < / code > used by this environment . */ public void setAutoScalingGroups ( java . util . Collection < AutoScalingGroup > autoScalingG...
if ( autoScalingGroups == null ) { this . autoScalingGroups = null ; return ; } this . autoScalingGroups = new com . amazonaws . internal . SdkInternalList < AutoScalingGroup > ( autoScalingGroups ) ;
public class JobSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( JobSummary jobSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( jobSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( jobSummary . getJobArn ( ) , JOBARN_BINDING ) ; protocolMarshaller . marshall ( jobSummary . getJobId ( ) , JOBID_BINDING ) ; protocolMarshaller . marshall ( jobSummary . get...
public class math { /** * Get a random position ( object ) from an array of generic objects . < br / > * Using generics saves the trouble of casting the return object . * @ param < T > * the type of the array to get the object from * @ param array * the array with objects * @ return random object from given...
if ( array == null || array . length == 0 ) { return null ; } return array [ getRandomInteger ( array . length - 1 ) ] ;
public class FnShort { /** * Determines whether the target object and the specified object are equal * by calling the < tt > equals < / tt > method on the target object . * @ param object the { @ link Short } to compare to the target * @ return true if both objects are equal , false if not . */ public static fina...
return ( Function < Short , Boolean > ) ( ( Function ) FnObject . eq ( object ) ) ;
public class DBService { /** * Return true if the given store name is a system table , aka metadata table . System * tables store column values as strings . All other tables use binary column values . * @ param storeName Store name to test . * @ return True if the store name is a system table . */ public static b...
return storeName . equals ( SchemaService . APPS_STORE_NAME ) || storeName . equals ( TaskManagerService . TASKS_STORE_NAME ) || storeName . equals ( TenantService . TENANTS_STORE_NAME ) ;
public class Finishables { /** * If the provided object is { @ link Finishable } , calls { @ link Finishable # finish ( ) } . If an * exception is thrown , it is logged and not propagated . */ public static void finishIfApplicableAndLogException ( Object toFinish ) { } }
try { finishIfApplicable ( ImmutableList . of ( toFinish ) ) ; } catch ( Exception e ) { log . info ( "Exception while finishing {}: {}" , toFinish , e ) ; }
public class StringUtils { /** * 对象数组转string * @ param args 对象 * @ return 不为null执行toString方法 * @ since 5.4.0 */ public static String objectsToString ( Object [ ] args ) { } }
if ( args == null ) { return null ; } else if ( args . length == 0 ) { return "[]" ; } else { StringBuilder sb = new StringBuilder ( ) . append ( "[" ) ; for ( Object arg : args ) { sb . append ( arg . toString ( ) ) . append ( "," ) ; } sb . setCharAt ( sb . length ( ) - 1 , ']' ) ; return sb . toString ( ) ; }
public class CDIContainerImpl { /** * Create BDAs for all runtime extensions that cannot see application bdas * @ param applicationContext * @ return * @ throws CDIException */ private Set < WebSphereBeanDeploymentArchive > createExtensionBDAs ( WebSphereCDIDeployment applicationContext ) throws CDIException { } ...
Set < WebSphereBeanDeploymentArchive > extensionBdas = new HashSet < WebSphereBeanDeploymentArchive > ( ) ; Set < ExtensionArchive > extensions = getExtensionArchives ( ) ; if ( extensions != null ) { for ( ExtensionArchive extArchive : extensions ) { WebSphereBeanDeploymentArchive moduleCDIContext = BDAFactory . creat...
public class AbstractMetricsRunnable { /** * Handles exceptions either by logging and swalling or by rethrowing as * { @ code RuntimeException } depending on the value of { @ code _ swallowException } . * @ param e An instance of < code > Exception < / code > . */ protected void handleException ( final Exception e ...
if ( _swallowException ) { _logger . warn ( "Metrics collection failed." , e ) ; } else { if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } else { throw new RuntimeException ( e ) ; } }
public class XmlParserBase { /** * Compose a resource to a stream , possibly using pretty presentation for a human reader , and maybe a different choice in the xhtml narrative ( used in the spec in one place , but should not be used in production ) */ public void compose ( OutputStream stream , Resource resource , bool...
XMLWriter writer = new XMLWriter ( stream , "UTF-8" ) ; writer . setPretty ( style == OutputStyle . PRETTY ) ; writer . start ( ) ; compose ( writer , resource , htmlPretty ) ; writer . end ( ) ;
public class HttpOutputStreamImpl { /** * Sets an observer for this output stream . The observer will be * notified when the stream is first written to . */ @ Override public void setObserver ( HttpOutputStreamObserver obs ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "obs ->" + obs ) ; } this . obs = obs ;
public class GreenPepperServerServiceImpl { /** * { @ inheritDoc } */ public Specification createSpecification ( Specification specification ) throws GreenPepperServerException { } }
try { sessionService . startSession ( ) ; sessionService . beginTransaction ( ) ; Repository repository = loadRepository ( specification . getRepository ( ) . getUid ( ) ) ; Specification specificationDb = documentDao . createSpecification ( null , specification . getRepository ( ) . getUid ( ) , specification . getNam...
public class CmsMessageBundleEditorModel { /** * Saves the current translations from the container to the respective localization . */ private void saveLocalization ( ) { } }
SortedProperties localization = new SortedProperties ( ) ; for ( Object itemId : m_container . getItemIds ( ) ) { Item item = m_container . getItem ( itemId ) ; String key = item . getItemProperty ( TableProperty . KEY ) . getValue ( ) . toString ( ) ; String value = item . getItemProperty ( TableProperty . TRANSLATION...
public class PostgreSqlExceptionTranslator { /** * Package private for testability * @ param pSqlException PostgreSQL exception * @ return translated validation exception */ MolgenisValidationException translateCheckConstraintViolation ( PSQLException pSqlException ) { } }
ServerErrorMessage serverErrorMessage = pSqlException . getServerErrorMessage ( ) ; String tableName = serverErrorMessage . getTable ( ) ; String constraintName = serverErrorMessage . getConstraint ( ) ; // constraint name : < tableName > _ < columnName > _ chk String columnName = constraintName . substring ( tableName...
public class SparseDoubleArray { /** * Divides the specified value to the index by the provided value and stores * the result at the index ( just as { @ code array [ index ] / = value } ) * @ param index the position in the array * @ param value the value by which the value at the index will be divided * @ retu...
if ( index < 0 || index >= maxLength ) throw new ArrayIndexOutOfBoundsException ( "invalid index: " + index ) ; int pos = Arrays . binarySearch ( indices , index ) ; // The divide operation is dividing a non - existent value in the // array , which is always 0 , so the corresponding result is 0. // Therefore , we don '...
public class GlobalConfiguration { /** * Loads the configuration files from the specified directory . * XML and YAML are supported as configuration files . If both XML and YAML files exist in the configuration * directory , keys from YAML will overwrite keys from XML . * @ param configDir * the directory which ...
if ( configDir == null ) { LOG . warn ( "Given configuration directory is null, cannot load configuration" ) ; return ; } final File confDirFile = new File ( configDir ) ; if ( ! ( confDirFile . exists ( ) ) ) { LOG . warn ( "The given configuration directory name '" + configDir + "' (" + confDirFile . getAbsolutePath ...
public class DescribeAccountAttributesResult { /** * A list of attributes assigned to an account . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAccountAttributes ( java . util . Collection ) } or { @ link # withAccountAttributes ( java . util . Collecti...
if ( this . accountAttributes == null ) { setAccountAttributes ( new com . amazonaws . internal . SdkInternalList < AccountAttribute > ( accountAttributes . length ) ) ; } for ( AccountAttribute ele : accountAttributes ) { this . accountAttributes . add ( ele ) ; } return this ;
public class SubscriptionSchedule { /** * Releases the subscription schedule immediately , which will stop scheduling of its phases , but * leave any existing subscription in place . A schedule can only be released if its status is * < code > not _ started < / code > or < code > active < / code > . If the subscript...
return release ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class Graphics { /** * Rotate a file a given number of degrees * @ param input input image file * @ param output the output image fiel * @ param format the format ( png , jpg , gif , etc . ) * @ param degrees angle to rotote * @ throws IOException */ public static void rotateImage ( File input , File o...
BufferedImage inputImage = ImageIO . read ( input ) ; Graphics2D g = ( Graphics2D ) inputImage . getGraphics ( ) ; g . drawImage ( inputImage , 0 , 0 , null ) ; AffineTransform at = new AffineTransform ( ) ; // scale image // at . scale ( 2.0 , 2.0 ) ; // rotate 45 degrees around image center at . rotate ( degrees * Ma...
public class HtmlBuilder { /** * Simple element . * @ param element Tag name * @ param id Element Id * @ param cssClass CSS class name */ public T element ( String element , String id , String cssClass ) throws IOException { } }
doBegin ( element , id , cssClass ) ; writer . write ( " />" ) ; return ( T ) this ;
public class CmsSetupDb { /** * Calls the create database script for the given database . < p > * @ param database the name of the database * @ param replacer the replacements to perform in the drop script */ public void createDatabase ( String database , Map < String , String > replacer ) { } }
m_errorLogging = true ; executeSql ( database , "create_db.sql" , replacer , true ) ;