signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class KeystoreConfigurationFactory { /** * Set the reference to the location manager . * Dynamic service : always use the most recent . * @ param locSvc Location service */ @ Reference ( service = WsLocationAdmin . class , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) p...
this . locSvc . setReference ( locSvc ) ;
public class SectionLoader { /** * Loads all bytes and information of the export section . The file on disk * is read to fetch the information . * @ return the export section * @ throws IOException * if unable to read the file * @ throws IllegalStateException * if unable to load section */ public ExportSect...
Optional < ExportSection > edata = maybeLoadExportSection ( ) ; return ( ExportSection ) getOrThrow ( edata , "unable to load export section" ) ;
public class RealSubscriptionManager { /** * Unsubscribe from all active subscriptions , and disconnect the web socket . It will not be * possible to add new subscriptions while the { @ link SubscriptionManager } is stopping * because we check the state in { @ link # doSubscribe ( Subscription , Callback ) } . We p...
synchronized ( this ) { setStateAndNotify ( State . STOPPING ) ; ArrayList < SubscriptionRecord > values = new ArrayList < > ( subscriptions . values ( ) ) ; for ( SubscriptionRecord subscription : values ) { doUnsubscribe ( subscription . subscription ) ; } disconnect ( true ) ; }
public class OpenSslX509KeyManagerFactory { /** * Create a new initialized { @ link OpenSslX509KeyManagerFactory } which loads its { @ link PrivateKey } directly from * an { @ code OpenSSL engine } via the * < a href = " https : / / www . openssl . org / docs / man1.1.0 / crypto / ENGINE _ load _ private _ key . ht...
KeyStore store = new OpenSslKeyStore ( certificateChain . clone ( ) , false ) ; store . load ( null , null ) ; OpenSslX509KeyManagerFactory factory = new OpenSslX509KeyManagerFactory ( ) ; factory . init ( store , password == null ? null : password . toCharArray ( ) ) ; return factory ;
public class TemplateException { /** * { @ inheritDoc } */ @ Override public List < String > getSource ( ) { } }
InputStream in = null ; try { if ( sourceUrl != null ) { in = sourceUrl . openStream ( ) ; return IOUtils . readLines ( in ) ; } } catch ( IOException e ) { throw new AmebaException ( e ) ; } finally { IOUtils . closeQuietly ( in ) ; } return Lists . newArrayList ( ) ;
public class AffineTransformation { /** * Add a reflection along the given axis . * @ param axis Axis number to do the reflection at . */ public void addAxisReflection ( int axis ) { } }
assert ( 0 < axis && axis <= dim ) ; // reset inverse transformation - needs recomputation . inv = null ; // Formal : // Matrix homTrans = Matrix . unitMatrix ( dim + 1 ) ; // homTrans [ axis - 1 ] [ axis - 1 ] = - 1; // trans = homTrans . times ( trans ) ; // Faster : for ( int i = 0 ; i <= dim ; i ++ ) { trans [ axis...
public class FastTrig { /** * Get the sine of an angle * @ param radians The angle * @ return The sine of the angle */ public static double sin ( double radians ) { } }
radians = reduceSinAngle ( radians ) ; // limits angle to between - PI / 2 and + PI / 2 if ( Math . abs ( radians ) <= Math . PI / 4 ) { return Math . sin ( radians ) ; } else { return Math . cos ( Math . PI / 2 - radians ) ; }
public class NutchResourceIndex { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . ResourceIndex # query ( org . archive . wayback . core . WaybackRequest ) */ public SearchResults query ( WaybackRequest wbRequest ) throws ResourceIndexNotAvailableException , ResourceNotInArchiveException , BadQueryExcep...
// Get the URL for the request : String requestUrl = getRequestUrl ( wbRequest ) ; Document document = null ; try { // HTTP Request + parse LOGGER . info ( "Requesting OpenSearch: " + requestUrl ) ; document = getHttpDocument ( requestUrl ) ; } catch ( IOException e ) { // TODO : better error for user : e . printStackT...
public class GenericsUtils { /** * Generics visibility ( from inside context class ) : * < ul > * < li > Generics declared on class < / li > * < li > Generics declared on outer class ( if current is inner ) < / li > * < li > Constructor generics ( if inside constructor ) < / li > * < li > Method generics ( if...
TypeVariable res = null ; for ( TypeVariable var : findVariables ( type ) ) { final Class < ? > target = getDeclarationClass ( var ) ; // declaration class must be context or it ' s outer class ( even if outer = null equals will be correct ) if ( ! target . equals ( context ) && ! target . equals ( TypeUtils . getOuter...
public class SerializerBase { /** * To fire off the PI trace event * @ param name Name of PI */ protected void fireEscapingEvent ( String name , String data ) throws org . xml . sax . SAXException { } }
if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_PI , name , data ) ; }
public class SpriteImpl { /** * Stretch the surface with the specified new size . * @ param newWidth The new width . * @ param newHeight The new height . */ protected void stretch ( int newWidth , int newHeight ) { } }
width = newWidth ; height = newHeight ; surface = Graphics . resize ( surfaceOriginal , newWidth , newHeight ) ;
public class MainActivity { /** * Start notify . */ public void onServerStart ( String ip ) { } }
closeDialog ( ) ; mBtnStart . setVisibility ( View . GONE ) ; mBtnStop . setVisibility ( View . VISIBLE ) ; mBtnBrowser . setVisibility ( View . VISIBLE ) ; if ( ! TextUtils . isEmpty ( ip ) ) { List < String > addressList = new LinkedList < > ( ) ; mRootUrl = "http://" + ip + ":8080/" ; addressList . add ( mRootUrl ) ...
public class JTATransactionManagerAdapter { public Object required ( TransactionCallback callback ) throws Throwable { } }
final boolean began = begin ( ) ; try { return callback . execute ( this ) ; } finally { if ( began ) { end ( ) ; } }
public class AtomDODeserializer { /** * Parses the id to determine a datastreamId . * @ param id * @ return */ private String getDatastreamId ( DigitalObject obj , Entry entry ) { } }
String entryId = entry . getId ( ) . toString ( ) ; // matches info : fedora / pid / dsid / timestamp Pattern pattern = Pattern . compile ( "^" + Constants . FEDORA . uri + ".+?/([^/]+)/?.*" ) ; Matcher matcher = pattern . matcher ( entryId ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } else { return ...
public class PeriodList { /** * { @ inheritDoc } */ public boolean addAll ( Collection < ? extends Period > arg0 ) { } }
for ( Period p : arg0 ) { add ( p ) ; } return true ;
public class JavaMelodyAutoConfiguration { /** * Monitoring of beans methods having the { @ link Scheduled } or { @ link Schedules } annotations . * @ return MonitoringSpringAdvisor */ @ Bean @ ConditionalOnProperty ( prefix = JavaMelodyConfigurationProperties . PREFIX , name = "scheduled-monitoring-enabled" , matchI...
// scheduled - monitoring - enabled was false by default because of # 643, // pending https : / / jira . spring . io / browse / SPR - 15562, // but true by default since 1.76 after adding dependency spring - boot - starter - aop return new MonitoringSpringAdvisor ( Pointcuts . union ( new AnnotationMatchingPointcut ( n...
public class Num { /** * 函数具体逻辑 * @ param scope 上下文 * @ return 计算好的节点 */ @ Override public XValue call ( Scope scope ) { } }
NodeTest textFun = Scanner . findNodeTestByName ( "allText" ) ; XValue textVal = textFun . call ( scope ) ; String whole = StringUtils . join ( textVal . asList ( ) , "" ) ; Matcher matcher = numExt . matcher ( whole ) ; if ( matcher . find ( ) ) { String numStr = matcher . group ( ) ; BigDecimal num = new BigDecimal (...
public class BitOutputStream { /** * If there are some unwritten bits , pad them if necessary and write them * out . * @ throws IOException * IO exception */ public void align ( ) throws IOException { } }
if ( capacity < BITS_IN_BYTE ) { ostream . write ( buffer << capacity ) ; capacity = BITS_IN_BYTE ; buffer = 0 ; len ++ ; }
public class JSAnonymousFunction { /** * Add the specified variable to the list of parameters for this function * signature . * @ param sName * Name of the parameter being added * @ return New parameter variable */ @ Nonnull public JSVar param ( @ Nonnull @ Nonempty final String sName ) { } }
final JSVar aVar = new JSVar ( sName , null ) ; m_aParams . add ( aVar ) ; return aVar ;
public class SyncLaunch { /** * ( non - Javadoc ) * @ see * org . parallelj . launching . transport . tcp . command . AbstractTcpCommand # process * ( org . apache . mina . core . session . IoSession , java . lang . String [ ] ) */ @ Override public final String process ( final IoSession session , final String .....
RemoteProgram remoteProgram = null ; // Get the corresponding remoteProgram try { remoteProgram = parseCommandLine ( args ) ; final Class < ? > jobClass = ( Class < ? > ) remoteProgram . getAdapterClass ( ) ; final Launcher launcher = Launcher . getLauncher ( ) ; final Launch < ? > launch = launcher . newLaunch ( jobCl...
public class ApiOvhDbaaslogs { /** * Returns actions of specified input * REST : GET / dbaas / logs / { serviceName } / input / { inputId } / action * @ param serviceName [ required ] Service name * @ param inputId [ required ] Input ID */ public ArrayList < OvhInputAction > serviceName_input_inputId_action_GET (...
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/action" ; StringBuilder sb = path ( qPath , serviceName , inputId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ;
public class SequenceManagerHelper { /** * Returns the root { @ link org . apache . ojb . broker . metadata . ClassDescriptor } of the inheriatance * hierachy of the given descriptor or the descriptor itself if no inheriatance on multiple table is * used . */ private static ClassDescriptor findInheritanceRoot ( Cla...
ClassDescriptor result = cld ; if ( cld . getSuperClassDescriptor ( ) != null ) { result = findInheritanceRoot ( cld . getSuperClassDescriptor ( ) ) ; } return result ;
public class ListT { /** * Construct an ListT from an AnyM that wraps a monad containing Lists * @ param monads AnyM that contains a monad wrapping an List * @ return ListT */ public static < W extends WitnessType < W > , A > ListT < W , A > of ( final AnyM < W , ? extends IndexedSequenceX < A > > monads ) { } }
return new ListT < > ( monads ) ;
public class ContentInfo { /** * Returns a byte array representation of the data held in * the content field . */ public byte [ ] getContentBytes ( ) throws IOException { } }
if ( content == null ) return null ; DerInputStream dis = new DerInputStream ( content . toByteArray ( ) ) ; return dis . getOctetString ( ) ;
public class NodeConfig { /** * 根据子节点名称获得子节点 * @ param name 子节点名称 * @ return 子节点 */ public NodeConfig getChildNodeByName ( String name ) { } }
if ( name == null ) { throw new NullPointerException ( "Node name is null" ) ; } if ( childrenNodes != null && childrenNodes . size ( ) > 0 ) { for ( NodeConfig childNode : childrenNodes ) { if ( childNode . getName ( ) . equals ( name ) ) { return childNode ; } } } return null ;
public class OutlookMessageParser { /** * Parses a . msg file provided by an input stream . * @ param msgFileStream The . msg file as a InputStream . * @ return A { @ link OutlookMessage } object representing the . msg file . * @ throws IOException Thrown if the file could not be loaded or parsed . */ public Outl...
// the . msg file , like a file system , contains directories and documents within this directories // we now gain access to the root node and recursively go through the complete ' filesystem ' . final OutlookMessage msg = new OutlookMessage ( rtf2htmlConverter ) ; try { checkDirectoryEntry ( new POIFSFileSystem ( msgF...
public class EventMention { /** * getter for anchor - gets * @ generated * @ return value of the feature */ public Anchor getAnchor ( ) { } }
if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_anchor == null ) jcasType . jcas . throwFeatMissing ( "anchor" , "de.julielab.jules.types.ace.EventMention" ) ; return ( Anchor ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( EventMention_Type ) ...
public class DuoCookie { /** * Parses a base64 - encoded Duo cookie , producing a new DuoCookie object * containing the data therein . If the given string is not a valid Duo * cookie , an exception is thrown . Note that the cookie may be expired , and * must be checked for expiration prior to actual use . * @ p...
// Attempt to decode data as base64 String data ; try { data = new String ( BaseEncoding . base64 ( ) . decode ( str ) , "UTF-8" ) ; } // Bail if invalid base64 is provided catch ( IllegalArgumentException e ) { throw new GuacamoleClientException ( "Username is not correctly " + "encoded as base64." , e ) ; } // Throw ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getMCARG ( ) { } }
if ( mcargEClass == null ) { mcargEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 413 ) ; } return mcargEClass ;
public class SimpleHadoopFilesystemConfigStore { /** * Retrieves the { @ link Config } for the given { @ link ConfigKeyPath } by reading the { @ link # MAIN _ CONF _ FILE _ NAME } * associated with the dataset specified by the given { @ link ConfigKeyPath } . If the { @ link Path } described by the * { @ link Confi...
Preconditions . checkNotNull ( configKey , "configKey cannot be null!" ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( version ) , "version cannot be null or empty!" ) ; Path datasetDir = getDatasetDirForKey ( configKey , version ) ; Path mainConfFile = new Path ( datasetDir , MAIN_CONF_FILE_NAME ) ; tr...
public class DefaultIdStrategy { /** * Registers a delegate by specifying the class name . Returns true if registration is successful . */ public < T > boolean registerDelegate ( String className , Delegate < T > delegate ) { } }
return null == delegateMapping . putIfAbsent ( className , new HasDelegate < T > ( delegate , this ) ) ;
public class ImportDialog { /** * GEN - LAST : event _ btOkActionPerformed */ private void btSearchInputDirActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ btSearchInputDirActionPerformed { } }
// GEN - HEADEREND : event _ btSearchInputDirActionPerformed if ( ! "" . equals ( txtInputDir . getText ( ) ) ) { File f = new File ( txtInputDir . getText ( ) ) ; if ( f . exists ( ) && ( f . isDirectory ( ) || "zip" . equals ( Files . getFileExtension ( f . getName ( ) ) ) ) ) { fileChooser . setSelectedFile ( f ) ; ...
public class PersonGroupsImpl { /** * Queue a person group training task , the training task may not be started immediately . * @ param personGroupId Id referencing a particular person group . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } ob...
return trainWithServiceResponseAsync ( personGroupId ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class BigtableTableAdminGrpcClient { /** * { @ inheritDoc } */ @ Override public void createTable ( CreateTableRequest request ) { } }
createUnaryListener ( request , createTableRpc , request . getParent ( ) ) . getBlockingResult ( ) ;
public class AbstractDataAccess { /** * Writes some internal data into the beginning of the specified file . */ protected void writeHeader ( RandomAccessFile file , long length , int segmentSize ) throws IOException { } }
file . seek ( 0 ) ; file . writeUTF ( "GH" ) ; file . writeLong ( length ) ; file . writeInt ( segmentSize ) ; for ( int i = 0 ; i < header . length ; i ++ ) { file . writeInt ( header [ i ] ) ; }
public class ReflectionUtils { /** * Load Class by class name . If class not found in it ' s Class loader or one of the parent class loaders - delegate to the Thread ' s ContextClassLoader * @ param className Canonical class name * @ return Class definition of className * @ throws ClassNotFoundException */ public...
try { return Class . forName ( className ) ; } catch ( ClassNotFoundException e ) { return Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( className ) ; }
public class TriangularSolver_DDRB { /** * Performs an in - place solve operation where T is contained in a single block . < br > * < br > * B = T < sup > - 1 < / sup > B < br > * < br > * where T is a triangular matrix contained in an inner block . T or B can be transposed . T must be a single complete inner b...
int Trows = T . row1 - T . row0 ; if ( Trows > blockLength ) throw new IllegalArgumentException ( "T can be at most the size of a block" ) ; // number of rows in a block . The submatrix can be smaller than a block final int blockT_rows = Math . min ( blockLength , T . original . numRows - T . row0 ) ; final int blockT_...
public class TablePlanner { /** * Constructs a product plan of the specified trunk and this table . * The select predicate applicable to this table is pushed down below the * product . * @ param trunk * the specified trunk of join * @ return a product plan of the trunk and this table */ public Plan makeProduc...
Plan p = makeSelectPlan ( ) ; return new MultiBufferProductPlan ( trunk , p , tx ) ;
public class KeyMatcher { /** * Access the bucket for this specific character . * @ param c * @ return HeaderBucket */ protected KeyBucket makeBucket ( char c ) { } }
if ( c > this . buckets . length ) { // can ' t handle non - ASCII chars return null ; } int index = c ; // if we ' re case - insensitive , push uppercase into lowercase buckets if ( ! isCaseSensitive ( ) && ( c >= 'A' && c <= 'Z' ) ) { index += 32 ; } if ( null == this . buckets [ index ] ) { this . buckets [ index ] ...
public class ConditionalCheck { /** * Ensures that a passed map as a parameter of the calling method is not empty . * We recommend to use the overloaded method { @ link Check # notEmpty ( Object [ ] , String ) } and pass as second argument * the name of the parameter to enhance the exception message . * @ param c...
IllegalNullArgumentException . class , IllegalEmptyArgumentException . class } ) public static < T > void notEmpty ( final boolean condition , @ Nonnull final T [ ] array ) { if ( condition ) { Check . notEmpty ( array ) ; }
public class PresentationControlImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . PRESENTATION_CONTROL__PRS_FLG : setPRSFlg ( PRS_FLG_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class ThreadGroup { /** * Resumes all threads in this thread group . * First , the < code > checkAccess < / code > method of this thread group is * called with no arguments ; this may result in a security exception . * This method then calls the < code > resume < / code > method on all the * threads in t...
int ngroupsSnapshot ; ThreadGroup [ ] groupsSnapshot ; synchronized ( this ) { checkAccess ( ) ; for ( int i = 0 ; i < nthreads ; i ++ ) { threads [ i ] . resume ( ) ; } ngroupsSnapshot = ngroups ; if ( groups != null ) { groupsSnapshot = Arrays . copyOf ( groups , ngroupsSnapshot ) ; } else { groupsSnapshot = null ; }...
public class HelloWorldHttp2Handler { /** * If receive a frame with end - of - stream set , send a pre - canned response . */ private static void onHeadersRead ( ChannelHandlerContext ctx , Http2HeadersFrame headers ) throws Exception { } }
if ( headers . isEndStream ( ) ) { ByteBuf content = ctx . alloc ( ) . buffer ( ) ; content . writeBytes ( RESPONSE_BYTES . duplicate ( ) ) ; ByteBufUtil . writeAscii ( content , " - via HTTP/2" ) ; sendResponse ( ctx , content ) ; }
public class Sequencer { /** * Looks to see if a sequencer has been generated for the sequence * with the specified name . If not , it will instantiate one . * Multiple calls to this method with the same name are guaranteed * to receive the same sequencer object . For best performance , * classes should save a ...
logger . debug ( "enter - getInstance()" ) ; try { Sequencer seq = null ; if ( sequencers . containsKey ( name ) ) { seq = sequencers . get ( name ) ; } if ( seq != null ) { return seq ; } synchronized ( sequencers ) { // redundant due to the non - synchronized calls above done for performance if ( ! sequencers . conta...
public class CPDefinitionLinkUtil { /** * Returns the cp definition link where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieveFromCache whether to ret...
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class BeanMap { /** * Returns the values for the BeanMap . * @ return values for the BeanMap . The returned collection is not * modifiable . */ @ Override public Collection < Object > values ( ) { } }
List < Object > answer = new ArrayList < Object > ( readMethods . size ( ) ) ; for ( Iterator < Object > iter = valueIterator ( ) ; iter . hasNext ( ) ; ) { answer . add ( iter . next ( ) ) ; } return answer ;
public class SCFLImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . SCFL__LID : return LID_EDEFAULT == null ? lid != null : ! LID_EDEFAULT . equals ( lid ) ; } return super . eIsSet ( featureID ) ;
public class InternalXbaseLexer { /** * $ ANTLR start " RULE _ INT " */ public final void mRULE_INT ( ) throws RecognitionException { } }
try { int _type = RULE_INT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalXbase . g : 16906:10 : ( ' 0 ' . . ' 9 ' ( ' 0 ' . . ' 9 ' | ' _ ' ) * ) // InternalXbase . g : 16906:12 : ' 0 ' . . ' 9 ' ( ' 0 ' . . ' 9 ' | ' _ ' ) * { matchRange ( '0' , '9' ) ; // InternalXbase . g : 16906:21 : ( ' 0 ' . . ' 9 ' | ' _ '...
public class InstanceCreator { /** * Create an instance of clazz * @ param clazz the clazz to create an instance of * @ param fallback a value provider which provides a fallback in case of a failure * @ param < T > the return type * @ return a new instance of clazz or fallback */ @ NonNull public < T > T create...
T t = create ( clazz ) ; return t != null ? t : fallback . get ( ) ;
public class AmazonCloudDirectoryClient { /** * Lists schema major versions applied to a directory . If < code > SchemaArn < / code > is provided , lists the minor * version . * @ param listAppliedSchemaArnsRequest * @ return Result of the ListAppliedSchemaArns operation returned by the service . * @ throws Int...
request = beforeClientExecution ( request ) ; return executeListAppliedSchemaArns ( request ) ;
public class BuildTasksInner { /** * Updates a build task with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildTaskName The name of the container registry buil...
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 ( registr...
public class SftpUtil { /** * Ensures that the directory exists and is writable by deleting the * directory and then recreate it . * @ param muleContext * @ param endpointName * @ throws org . mule . api . MuleException * @ throws java . io . IOException * @ throws com . jcraft . jsch . SftpException */ pub...
SftpClient sftpClient = getSftpClient ( muleContext , endpointName ) ; try { ChannelSftp channelSftp = sftpClient . getChannelSftp ( ) ; try { recursiveDelete ( muleContext , sftpClient , endpointName , "" ) ; } catch ( IOException e ) { if ( logger . isErrorEnabled ( ) ) logger . error ( "Failed to recursivly delete e...
public class LinearClassifierFactory { /** * Sets the sigma parameter to a value that optimizes the held - out score given by < code > scorer < / code > . Search for an optimal value * is carried out by < code > minimizer < / code > * dataset the data set to optimize sigma on . * kfold * @ return an interim set...
featureIndex = trainSet . featureIndex ; labelIndex = trainSet . labelIndex ; // double [ ] resultWeights = null ; Timing timer = new Timing ( ) ; NegativeScorer negativeScorer = new NegativeScorer ( trainSet , devSet , scorer , timer ) ; timer . start ( ) ; double bestSigma = minimizer . minimize ( negativeScorer ) ; ...
public class KriptonContentValues { /** * Key list . * @ return the string */ public String keyList ( ) { } }
String separator = "" ; StringBuilder buffer = new StringBuilder ( ) ; String item ; for ( int i = 0 ; i < names . size ( ) ; i ++ ) { item = names . get ( i ) ; buffer . append ( separator + item ) ; separator = ", " ; } return buffer . toString ( ) ;
public class ComputerLauncher { /** * Launches the agent for the given { @ link Computer } . * If the agent is launched successfully , { @ link SlaveComputer # setChannel ( InputStream , OutputStream , TaskListener , Channel . Listener ) } * should be invoked in the end to notify Hudson of the established connectio...
// to remain compatible with the legacy implementation that overrides the old signature launch ( computer , cast ( listener ) ) ;
public class NodeVector { /** * Pop a node from the tail of the vector and return the * top of the stack after the pop . * @ return The top of the stack after it ' s been popped */ public final int popAndTop ( ) { } }
m_firstFree -- ; m_map [ m_firstFree ] = DTM . NULL ; return ( m_firstFree == 0 ) ? DTM . NULL : m_map [ m_firstFree - 1 ] ;
public class MethodMetadata { /** * 根据method构建method元数据 * @ param method method * @ return method元数据 */ public static MethodMetadata build ( Method method ) { } }
return new MethodMetadata ( method . getName ( ) , method . getDeclaringClass ( ) , method , method . getParameterTypes ( ) ) ;
public class HttpBasicAuthLogicHandler { /** * { @ inheritDoc } */ @ Override public void handleResponse ( final HttpProxyResponse response ) throws ProxyAuthException { } }
if ( response . getStatusCode ( ) != 407 ) { throw new ProxyAuthException ( "Received error response code (" + response . getStatusLine ( ) + ")." ) ; }
public class MessageType { /** * Returns the corresponding MessageType for a given Byte . * This method should NOT be called by any code outside the MFP component . * It is only public so that it can be accessed by sub - packages . * @ param aValue The Byte for which an MessageType is required . * @ return The ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue . intValue ( ) ] ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public OBPRefCSys createOBPRefCSysFromString ( EDataType eDataType , String initialValue ) { } }
OBPRefCSys result = OBPRefCSys . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class PeriodDuration { /** * Returns a copy of this instance with the days and duration normalized using the standard day of 24 hours . * This normalizes the days and duration , leaving the years and months unchanged . * The result uses a standard day length of 24 hours . * This combines the duration secon...
long totalSecs = period . getDays ( ) * SECONDS_PER_DAY + duration . getSeconds ( ) ; int splitDays = Math . toIntExact ( totalSecs / SECONDS_PER_DAY ) ; long splitSecs = totalSecs % SECONDS_PER_DAY ; if ( splitDays == period . getDays ( ) && splitSecs == duration . getSeconds ( ) ) { return this ; } return PeriodDurat...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcFuelProperties ( ) { } }
if ( ifcFuelPropertiesEClass == null ) { ifcFuelPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 258 ) ; } return ifcFuelPropertiesEClass ;
public class CommercePaymentMethodGroupRelPersistenceImpl { /** * Returns all the commerce payment method group rels . * @ return the commerce payment method group rels */ @ Override public List < CommercePaymentMethodGroupRel > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class GrantListEntry { /** * The list of operations permitted by the grant . * @ param operations * The list of operations permitted by the grant . * @ see GrantOperation */ public void setOperations ( java . util . Collection < String > operations ) { } }
if ( operations == null ) { this . operations = null ; return ; } this . operations = new com . ibm . cloud . objectstorage . internal . SdkInternalList < String > ( operations ) ;
public class LongStreamEx { /** * Produces an array containing cumulative results of applying the * accumulation function going left to right . * This is a terminal operation . * For parallel stream it ' s not guaranteed that accumulator will always be * executed in the same thread . * This method cannot take...
Spliterator . OfLong spliterator = spliterator ( ) ; long size = spliterator . getExactSizeIfKnown ( ) ; LongBuffer buf = new LongBuffer ( size >= 0 && size <= Integer . MAX_VALUE ? ( int ) size : INITIAL_SIZE ) ; delegate ( spliterator ) . forEachOrdered ( i -> buf . add ( buf . size == 0 ? i : accumulator . applyAsLo...
public class DisassociateDiscoveredResourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DisassociateDiscoveredResourceRequest disassociateDiscoveredResourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( disassociateDiscoveredResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateDiscoveredResourceRequest . getProgressUpdateStream ( ) , PROGRESSUPDATESTREAM_BINDING ) ; protocolMarshaller . marshall ( disassociate...
public class CountingFlushableAppendable { /** * Soy is about to block on a future . Flush the output stream if there is anything to flush , * so we use the time we are blocking to transfer as many bytes as possible . */ @ Override public void beforeBlock ( ) { } }
if ( count > 0 ) { try { flush ( ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , "Flush from soy failed" , e ) ; } }
public class Message { /** * Note that you cannot use this method to read a buffer wrapping the array returned from toByteArray as the internal representation is different ! * @ param buffer */ public void read ( ByteBuffer buffer ) { } }
Persistables . persistable ( streamableNoBuffers ( ) ) . read ( buffer ) ; final int n = getNumDataBuffers ( ) ; int lengthsPosition = buffer . position ( ) ; buffer . position ( buffer . position ( ) + 2 * n ) ; // skip positions for ( int i = 0 ; i < n ; i ++ ) { final int size = buffer . getShort ( lengthsPosition )...
public class OrderAction { /** * Moves the currently selected entity { @ code amount } positions < b > UP < / b > * in order by pushing all entities down by one position . * @ param amount * The amount of positions that should be moved * @ throws java . lang . IllegalStateException * If no entity has been sel...
Checks . notNegative ( amount , "Provided amount" ) ; if ( selectedPosition == - 1 ) throw new IllegalStateException ( "Cannot move until an item has been selected. Use #selectPosition first." ) ; if ( ascendingOrder ) { Checks . check ( selectedPosition - amount >= 0 , "Amount provided to move up is too large and woul...
public class CmsFlexCache { /** * Returns all variations in the cache for a given resource name . * The variations are of type String . < p > * Useful if you want to show a list of all cached entry - variations , * like on the FlexCache administration page . < p > * Only users with administrator permissions are...
if ( ! isEnabled ( ) || ! OpenCms . getRoleManager ( ) . hasRole ( cms , CmsRole . WORKPLACE_MANAGER ) ) { return null ; } Object o = m_keyCache . get ( key ) ; if ( o != null ) { return synchronizedCopyKeys ( ( ( CmsFlexCacheVariation ) o ) . m_map ) ; } return null ;
public class ValidateCreditCard { /** * Convert a creditCardNumber as long to a formatted String . Currently it breaks 16 - digit numbers * into groups of 4. * @ param creditCardNumber number on card . * @ return String representation of the credit card number . */ private static String toPrettyString ( long cred...
String plain = Long . toString ( creditCardNumber ) ; // int i = findMatchingRange ( creditCardNumber ) ; int length = plain . length ( ) ; switch ( length ) { case 12 : // 12 pattern 3-3-3-3 return plain . substring ( 0 , 3 ) + ' ' + plain . substring ( 3 , 6 ) + ' ' + plain . substring ( 6 , 9 ) + ' ' + plain . subst...
public class EntityScanPackages { /** * Register the specified entity scan packages with the system . * @ param registry the source registry * @ param packageNames the package names to register */ public static void register ( BeanDefinitionRegistry registry , String ... packageNames ) { } }
Assert . notNull ( registry , "Registry must not be null" ) ; Assert . notNull ( packageNames , "PackageNames must not be null" ) ; register ( registry , Arrays . asList ( packageNames ) ) ;
public class JMElasticsearchSearchAndCount { /** * Gets search request builder . * @ param queryBuilder the query builder * @ param indices the indices * @ return the search request builder */ public SearchRequestBuilder getSearchRequestBuilder ( QueryBuilder queryBuilder , String ... indices ) { } }
return getSearchRequestBuilder ( indices , null , queryBuilder ) ;
public class PackageManagerUtils { /** * Checks if the device has a input methods . * @ param context the context . * @ return { @ code true } if the device has a input methods . */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN_MR2 ) public static boolean hasInputMethodsFeature ( Context context ) { } }
return hasInputMethodsFeature ( context . getPackageManager ( ) ) ;
public class BootiqueSarlcMain { /** * Replies the options of the program . * @ return the options of the program . */ public List < HelpOption > getOptions ( ) { } }
final BQRuntime runtime = createRuntime ( ) ; final ApplicationMetadata application = runtime . getInstance ( ApplicationMetadata . class ) ; final HelpOptions helpOptions = new HelpOptions ( ) ; application . getCommands ( ) . forEach ( c -> { helpOptions . add ( c . asOption ( ) ) ; c . getOptions ( ) . forEach ( o -...
public class Tuple2 { /** * Returns a new instance . * @ param r * first element * @ param s * second element * @ param < R > type of first element * @ param < S > * type of second element * @ return tuple */ public static < R , S > Tuple2 < R , S > create ( R r , S s ) { } }
return new Tuple2 < R , S > ( r , s ) ;
public class ProcessContext { /** * Creates a new context using an RBAC access control model . < br > * Users and permissions to execute transactions are randomly assigned * to the given roles . < br > * Each person is assigned to exactly one role . * @ param activities The process activities . * @ param orig...
Validate . notNull ( activities ) ; Validate . noNullElements ( activities ) ; Validate . notNegative ( originatorCount ) ; Validate . notNull ( roles ) ; Validate . noNullElements ( roles ) ; ProcessContext newContext = new ProcessContext ( "Random Context" ) ; newContext . setActivities ( activities ) ; List < String...
public class OpenGL3DParallelCoordinates { /** * Hack : Get / Create the style result . * @ return Style result */ public StylingPolicy getStylePolicy ( ResultHierarchy hier , StyleLibrary stylelib ) { } }
Database db = ResultUtil . findDatabase ( hier ) ; AutomaticEvaluation . ensureClusteringResult ( db , db ) ; List < Clustering < ? extends Model > > clusterings = Clustering . getClusteringResults ( db ) ; if ( clusterings . isEmpty ( ) ) { throw new AbortException ( "No clustering result generated?!?" ) ; } return ne...
public class TransactionLogger { /** * Create new logging action * This method check if there is an old instance for this thread - local * If not - Initialize new instance and set it as this thread - local ' s instance * @ param logger * @ param auditor * @ param instance * @ return whether new instance was...
TransactionLogger oldInstance = getInstance ( ) ; if ( oldInstance == null || oldInstance . finished ) { if ( loggingKeys == null ) { synchronized ( TransactionLogger . class ) { if ( loggingKeys == null ) { logger . info ( "Initializing 'LoggingKeysHandler' class" ) ; loggingKeys = new LoggingKeysHandler ( keysPropStr...
public class BasicActor { /** * public void pause ( boolean enabled ) { if ( enabled ) { * characterControl . setEnabled ( ! enabled ) ; * autonomousMovementControl . setEnabled ( ! enabled ) ; * basicCharacterAnimControl . setEnabled ( ! enabled ) ; * kinematicRagdollControl . setEnabled ( ! enabled ) ; } else...
if ( autonomousMovementControl != null ) { ( ( AbstractControl ) autonomousMovementControl ) . setEnabled ( true ) ; return autonomousMovementControl . moveTo ( location ) ; } return false ;
public class ConfigurationModule { /** * Binds a list to a specific optional / required Impl using ConfigurationModule . * @ param opt Target optional / required Impl * @ param implList List object to be injected * @ param < T > a type * @ return the configuration module */ public final < T > ConfigurationModul...
final ConfigurationModule c = deepCopy ( ) ; c . processSet ( opt ) ; c . setImplLists . put ( opt , implList ) ; return c ;
public class Delivery { /** * Show / Create a DialogFragment on the provided FragmentTransaction * to be executed and shown . * @ see android . app . DialogFragment # show ( android . app . FragmentTransaction , String ) * @ param transaction the fragment transaction used to show the dialog * @ param tag the ta...
mActiveMail = generateDialogFragment ( ) ; mActiveMail . show ( transaction , tag ) ;
public class PicoNetwork { /** * Start this VoltNetwork ' s thread . populate the verbotenThreads set * with the id of the thread that is created */ public void start ( InputHandler ih , Set < Long > verbotenThreads ) { } }
m_ih = ih ; m_verbotenThreads = verbotenThreads ; startSetup ( ) ; m_thread . start ( ) ;
public class StreamT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # onEmpty ( java . lang . Object ) */ @ Override public StreamT < W , T > onEmpty ( final T value ) { } }
return ( StreamT < W , T > ) FoldableTransformerSeq . super . onEmpty ( value ) ;
public class WrappedByteBuffer { /** * Puts a two - byte short into the buffer at the specified index . * @ param index the index * @ param v the two - byte short * @ return the buffer */ public WrappedByteBuffer putShortAt ( int index , short v ) { } }
_checkForWriteAt ( index , 2 ) ; _buf . putShort ( index , v ) ; return this ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcStackTerminalTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class ServerService { /** * Import server from ovf image * @ param config server config * @ return OperationFuture wrapper for ServerMetadata */ public OperationFuture < ServerMetadata > importServer ( ImportServerConfig config ) { } }
BaseServerResponse response = client . importServer ( serverConverter . buildImportServerRequest ( config , config . getCustomFields ( ) . isEmpty ( ) ? null : client . getCustomFields ( ) ) ) ; return postProcessBuildServerResponse ( response , config ) ;
public class Layout { /** * Materializes the layout , under the specified parent . * @ param parent Parent UI element at this level of the hierarchy . May be null . * @ param node The current layout element . * @ param ignoreInternal Ignore internal elements . */ private void materializeChildren ( ElementBase par...
for ( LayoutNode child : node . getChildren ( ) ) { PluginDefinition def = child . getDefinition ( ) ; ElementBase element = ignoreInternal && def . isInternal ( ) ? null : createElement ( parent , child ) ; if ( element != null ) { materializeChildren ( element , ( LayoutElement ) child , false ) ; } } for ( LayoutTri...
public class ApiResource { /** * Similar to # request , but specific for use with collection types that * come from the API ( i . e . lists of resources ) . * < p > Collections need a little extra work because we need to plumb request * options and params through so that we can iterate to the next page if * nec...
T collection = request ( RequestMethod . GET , url , params , clazz , options ) ; if ( collection != null ) { collection . setRequestOptions ( options ) ; collection . setRequestParams ( params ) ; } return collection ;
public class JobXMLDescriptorImpl { /** * Returns all < code > decision < / code > elements * @ return list of < code > decision < / code > */ public List < Decision < JobXMLDescriptor > > getAllDecision ( ) { } }
List < Decision < JobXMLDescriptor > > list = new ArrayList < Decision < JobXMLDescriptor > > ( ) ; List < Node > nodeList = model . get ( "decision" ) ; for ( Node node : nodeList ) { Decision < JobXMLDescriptor > type = new DecisionImpl < JobXMLDescriptor > ( this , "decision" , model , node ) ; list . add ( type ) ;...
public class StringUtil { /** * Given a string , returns the representation of that string * as a Java string literal . */ public static String javaQuotedLiteral ( String value ) { } }
StringBuilder b = new StringBuilder ( value . length ( ) * 2 ) ; b . append ( '"' ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { char c = value . charAt ( i ) ; switch ( c ) { case '"' : b . append ( "\\\"" ) ; break ; case '\\' : b . append ( "\\\\" ) ; break ; case '\n' : b . append ( "\\n" ) ; break ; case ...
public class ObjectByteOffsetImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . OBJECT_BYTE_OFFSET__DIR_BY_OFF : return DIR_BY_OFF_EDEFAULT == null ? dirByOff != null : ! DIR_BY_OFF_EDEFAULT . equals ( dirByOff ) ; case AfplibPackage . OBJECT_BYTE_OFFSET__DIR_BY_HI : return DIR_BY_HI_EDEFAULT == null ? dirByHi != null : ! DIR_BY_HI_EDEFAULT . equals ( di...
public class XmlLineNumberParser { /** * Parses the XML . * @ param is the XML content as an input stream * @ param rootNames one or more root names that is used as baseline for beginning the parsing , for example camelContext to start parsing * when Camel is discovered . Multiple names can be defined separated b...
final Document doc ; SAXParser parser ; final SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; parser = factory . newSAXParser ( ) ; final DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; // turn off validator and loading external dtd dbf . setValidating ( false ) ; dbf . setNamesp...
public class AbstractClient { /** * { @ inheritDoc } */ @ Override public void delayedEnqueue ( final String queue , final Job job , final long future ) { } }
validateArguments ( queue , job , future ) ; try { doDelayedEnqueue ( queue , ObjectMapperFactory . get ( ) . writeValueAsString ( job ) , future ) ; } catch ( RuntimeException re ) { throw re ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class UserMessages { public void add ( String property , UserMessage message ) { } }
assertArgumentNotNull ( "property" , property ) ; assertArgumentNotNull ( "message" , message ) ; assertLocked ( ) ; final UserMessageItem item = getPropertyItem ( property ) ; final List < UserMessage > messageList ; if ( item == null ) { ++ itemCount ; messageList = new ArrayList < UserMessage > ( ) ; final String fi...
public class ModifyEndpointRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ModifyEndpointRequest modifyEndpointRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( modifyEndpointRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( modifyEndpointRequest . getEndpointArn ( ) , ENDPOINTARN_BINDING ) ; protocolMarshaller . marshall ( modifyEndpointRequest . getEndpointIdentifier ( ) , ENDPOINTID...
public class RESTWebService { /** * Parse sentence . * @ param sentence sentence . * @ param request http servlet request . * @ return parse tree JSON . */ @ RequestMapping ( produces = MediaType . APPLICATION_JSON_VALUE , value = "/parse" , method = RequestMethod . GET ) public String parse ( @ RequestParam ( "s...
if ( sentence == null || sentence . trim ( ) . isEmpty ( ) ) { return StringUtils . EMPTY ; } sentence = sentence . trim ( ) ; LOGGER . info ( "Parse [" + sentence + "]" ) ; DTree tree = PARSER . parse ( sentence ) ; DTreeEntity parseTreeEntity = new DTreeEntity ( tree , "SAMPLE_AUTHOR" ) ; dNodeEntityRepository . save...
public class AppBndAuthorizationTableService { /** * Update the map for the specified group name . If the accessID is * successfully computed , the map will be updated with the accessID . * If the accessID can not be computed due to the user not being found , * INVALID _ ACCESS _ ID will be stored . * @ param m...
String accessIdFromRole ; accessIdFromRole = getMissingAccessId ( group ) ; if ( accessIdFromRole != null ) { maps . groupToAccessIdMap . put ( groupNameFromRole , accessIdFromRole ) ; } else { // Unable to compute the accessId , store an invalid access ID indicate this // and avoid future attempts maps . groupToAccess...
public class WorkflowManagerAbstract { /** * / * ( non - Javadoc ) * @ see nz . co . senanque . workflow . WorkflowManager # findHandlerTasks ( nz . co . senanque . workflow . instances . ProcessInstance ) */ @ Transactional public List < Audit > findHandlerTasks ( ProcessInstance processInstance ) { } }
Stack < Audit > ret = new Stack < Audit > ( ) ; for ( Audit audit : processInstance . getAudits ( ) ) { if ( audit . isHandler ( ) && audit . getStatus ( ) != null ) { ret . push ( audit ) ; } } return ret ;
public class CmsGalleryControllerHandler { /** * Deletes the html content of the types parameter and removes the style . < p > * @ param types the types to be removed from selection */ public void onClearTypes ( List < String > types ) { } }
if ( types != null ) { m_galleryDialog . getTypesTab ( ) . uncheckTypes ( types ) ; }