signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ObrClassFinderService { /** * Bundle shutting down . */
public void stop ( BundleContext context ) throws Exception { } } | ClassServiceUtility . log ( context , LogService . LOG_INFO , "Stopping ObrClassFinderImpl" ) ; super . stop ( context ) ; repositoryAdmin = null ; waitingForRepositoryAdmin = false ; waitingForClassService = false ; ClassFinderActivator . setClassFinder ( null ) ; |
public class SegmentMeanShiftSearchColor { /** * Uses mean - shift to find the peak . Returns the peak as an index in the image data array .
* @ param meanColor The color value which mean - shift is trying to find a region which minimises it */
protected void findPeak ( float cx , float cy , float [ ] meanColor ) { }... | history . reset ( ) ; history . grow ( ) . set ( cx , cy ) ; for ( int i = 0 ; i < maxIterations ; i ++ ) { float total = 0 ; float sumX = 0 , sumY = 0 ; Arrays . fill ( sumColor , 0 ) ; int kernelIndex = 0 ; float x0 = cx - radiusX ; float y0 = cy - radiusY ; // If it is not near the image border it can use faster tec... |
public class WriteResources { /** * CreateFile Method . */
public StreamOut createFile ( String strFullFileName ) { } } | StreamOut streamOut = null ; try { File file = new File ( strFullFileName ) ; String pathName = file . getParent ( ) ; File fileDir = new File ( pathName ) ; fileDir . mkdirs ( ) ; streamOut = new StreamOut ( strFullFileName ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; streamOut = null ; } return streamO... |
public class MembershipHandlerImpl { /** * Migrates user memberships from old storage into new .
* @ param oldUserNode
* the node where user properties are stored ( from old structure )
* @ throws Exception */
void migrateMemberships ( Node oldUserNode ) throws Exception { } } | Session session = oldUserNode . getSession ( ) ; NodeIterator iterator = ( ( ExtendedNode ) oldUserNode ) . getNodesLazily ( ) ; while ( iterator . hasNext ( ) ) { Node oldMembershipNode = iterator . nextNode ( ) ; if ( oldMembershipNode . isNodeType ( MigrationTool . JOS_USER_MEMBERSHIP ) ) { String oldGroupUUID = uti... |
public class ConfigurableInterpreter { /** * Returns the result from applying the accumulator in all the nodes .
* @ param nodes
* flattened tree
* @ return the result from applying the accumulator */
private final V process ( final Iterable < DiceNotationExpression > nodes ) { } } | accumulator . reset ( ) ; for ( final DiceNotationExpression current : nodes ) { if ( current instanceof BinaryOperation ) { accumulator . binaryOperation ( ( BinaryOperation ) current ) ; } else if ( current instanceof ConstantOperand ) { accumulator . constantOperand ( ( ConstantOperand ) current ) ; } else if ( curr... |
public class ArchetypeMerger { /** * / * Returns matching ( parent , specialized ) pairs of children of an attribute , in the order they should be present in
* the flattened model . One of the element may be null in case of no specialization or extension . */
private List < Pair < CObject > > getChildPairs ( RmPath p... | List < Pair < CObject > > result = new ArrayList < > ( ) ; for ( CObject parentChild : parent . getChildren ( ) ) { result . add ( new Pair < > ( parentChild , findSpecializedConstraintOfParentNode ( specialized , parentChild ) ) ) ; } for ( CObject specializedChild : specialized . getChildren ( ) ) { CObject parentChi... |
public class VisualizationManager { /** * Visualize a source to a file for a certain ebInterface version .
* @ param eVersion
* ebInterface version to use . May not be < code > null < / code > .
* @ param aResource
* Source resource . May not be < code > null < / code > .
* @ param aDestinationFile
* The fi... | return visualize ( eVersion , TransformSourceFactory . create ( aResource ) , TransformResultFactory . create ( aDestinationFile ) ) ; |
public class MaterializeKNNAndRKNNPreprocessor { /** * Extracts and removes the DBIDs in the given collections .
* @ param extract a list of lists of DistanceResultPair to extract
* @ param remove the ids to remove
* @ return the DBIDs in the given collection */
protected ArrayDBIDs affectedkNN ( List < ? extends... | HashSetModifiableDBIDs ids = DBIDUtil . newHashSet ( ) ; for ( KNNList drps : extract ) { for ( DBIDIter iter = drps . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { ids . add ( iter ) ; } } ids . removeDBIDs ( remove ) ; // Convert back to array
return DBIDUtil . newArray ( ids ) ; |
public class DescribeReservedCacheNodesOfferingsResult { /** * A list of reserved cache node offerings . Each element in the list contains detailed information about one
* offering .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setReservedCacheNodesOffer... | if ( this . reservedCacheNodesOfferings == null ) { setReservedCacheNodesOfferings ( new com . amazonaws . internal . SdkInternalList < ReservedCacheNodesOffering > ( reservedCacheNodesOfferings . length ) ) ; } for ( ReservedCacheNodesOffering ele : reservedCacheNodesOfferings ) { this . reservedCacheNodesOfferings . ... |
public class MessageArgsUnitParser { /** * Select a factor set based on a name , used to format compact units . For example ,
* if compact = " bytes " we return a factor set DIGITAL _ BYTES . This set is then used
* to produce the most compact form for a given value , e . g . " 1.2MB " , " 37TB " , etc . */
protect... | if ( compact != null ) { switch ( compact ) { case "angle" : case "angles" : return UnitFactorSets . ANGLE ; case "area" : return converter . areaFactors ( ) ; case "bit" : case "bits" : return UnitFactorSets . DIGITAL_BITS ; case "byte" : case "bytes" : return UnitFactorSets . DIGITAL_BYTES ; case "duration" : return ... |
public class AWSCodePipelineClient { /** * Returns information about any jobs for AWS CodePipeline to act upon . PollForJobs is only valid for action types
* with " Custom " in the owner field . If the action type contains " AWS " or " ThirdParty " in the owner field , the
* PollForJobs action returns an error .
... | request = beforeClientExecution ( request ) ; return executePollForJobs ( request ) ; |
public class CopyObjectRequest { /** * Sets the AWS Key Management System parameters used to encrypt the object
* on server side . */
public void setSSEAwsKeyManagementParams ( SSEAwsKeyManagementParams params ) { } } | if ( params != null && this . destinationSSECustomerKey != null ) { throw new IllegalArgumentException ( "Either SSECustomerKey or SSEAwsKeyManagementParams must not be set at the same time." ) ; } this . sseAwsKeyManagementParams = params ; |
public class AbstractJMeterMojo { /** * Try to load the active maven proxy . */
protected void loadMavenProxy ( ) { } } | if ( null == settings ) { return ; } Proxy mvnProxy = settings . getActiveProxy ( ) ; if ( mvnProxy != null ) { ProxyConfiguration newProxyConfiguration = new ProxyConfiguration ( ) ; newProxyConfiguration . setHost ( mvnProxy . getHost ( ) ) ; newProxyConfiguration . setPort ( mvnProxy . getPort ( ) ) ; newProxyConfig... |
public class ProxyFactory { /** * Adds the following code to a delegating method :
* < code >
* if ( ! this . constructed ) return super . thisMethod ( )
* < / code >
* This means that the proxy will not start to delegate to the underlying
* bean instance until after the constructor has finished . */
protecte... | if ( ! useConstructedFlag ( ) ) { return ; } // now create the conditional
final CodeAttribute cond = classMethod . getCodeAttribute ( ) ; cond . aload ( 0 ) ; cond . getfield ( classMethod . getClassFile ( ) . getName ( ) , CONSTRUCTED_FLAG_NAME , BytecodeUtils . BOOLEAN_CLASS_DESCRIPTOR ) ; // jump if the proxy const... |
public class BoltSendableResponseCallback { /** * 发送响应数据
* @ param response 响应
* @ param sofaException SofaRpcException */
protected void sendSofaResponse ( SofaResponse response , SofaRpcException sofaException ) { } } | try { if ( RpcInvokeContext . isBaggageEnable ( ) ) { BaggageResolver . carryWithResponse ( RpcInvokeContext . peekContext ( ) , response ) ; } asyncContext . sendResponse ( response ) ; } finally { if ( EventBus . isEnable ( ServerSendEvent . class ) ) { EventBus . post ( new ServerSendEvent ( request , response , sof... |
public class BaseProfile { /** * generate package . html
* @ param def Definition
* @ param outputDir main or test
* @ param subDir sub - directory */
void generatePackageInfo ( Definition def , String outputDir , String subDir ) { } } | try { FileWriter fw ; PackageInfoGen phGen ; if ( outputDir . equals ( "test" ) ) { fw = Utils . createTestFile ( "package-info.java" , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; phGen = new PackageInfoGen ( ) ; } else { if ( subDir == null ) { fw = Utils . createSrcFile ( "package-info.java" , def . getRaPack... |
public class Data { /** * Sort a list
* @ param < T > the type
* @ param aVOs the value objects
* @ return collection the sorted criteria */
public static < T > Collection < T > sortByCriteria ( Collection < T > aVOs ) { } } | final List < T > list ; if ( aVOs instanceof List ) list = ( List < T > ) aVOs ; else list = new ArrayList < T > ( aVOs ) ; Collections . sort ( list , new CriteriaComparator ( ) ) ; return list ; |
public class ZipUtil { /** * Unpacks a single entry from a ZIP stream .
* @ param is
* ZIP stream .
* @ param name
* entry name .
* @ return contents of the entry or < code > null < / code > if it was not found . */
public static byte [ ] unpackEntry ( InputStream is , String name ) { } } | ByteArrayUnpacker action = new ByteArrayUnpacker ( ) ; if ( ! handle ( is , name , action ) ) return null ; // entry not found
return action . getBytes ( ) ; |
public class FileSystem { /** * Decode the given file to obtain a string representation
* which is compatible with the URL standard .
* This function was introduced to have a work around
* on the ' \ ' character on Windows operating system .
* @ param file the file .
* @ return the string representation of th... | if ( file == null ) { return null ; } if ( isFileCompatibleWithURL == null ) { isFileCompatibleWithURL = Boolean . valueOf ( URL_PATH_SEPARATOR . equals ( File . separator ) ) ; } String filePath = file ; if ( ! isFileCompatibleWithURL ) { filePath = filePath . replaceAll ( Pattern . quote ( File . separator ) , Matche... |
public class SequenceConverter { /** * method to get for all peptides the sequence
* @ param helm2notation
* HELM2Notation
* @ return rna sequences divided by white space
* @ throws HELM2HandledException
* if the polymer contains HELM2 features
* @ throws PeptideUtilsException
* if the polymer is not a pe... | List < PolymerNotation > polymers = helm2notation . getListOfPolymers ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( PolymerNotation polymer : polymers ) { sb . append ( PeptideUtils . getSequence ( polymer ) + " " ) ; } sb . setLength ( sb . length ( ) - 1 ) ; return sb . toString ( ) ; |
public class CollidableUpdater { /** * IdentifiableListener */
@ Override public void notifyDestroyed ( Integer id ) { } } | enabled = false ; boxs . clear ( ) ; cacheColls . clear ( ) ; cacheRect . clear ( ) ; |
public class DocBookBuilder { /** * Creates a dummy translated topic so that a book can be built using the same relationships as a normal build .
* @ param topic The topic to create the dummy topic from .
* @ param locale The locale to build the dummy translations for .
* @ return The dummy translated topic . */
... | final TranslatedTopicWrapper translatedTopic = translatedTopicProvider . newTranslatedTopic ( ) ; translatedTopic . setTopic ( topic ) ; translatedTopic . setId ( topic . getId ( ) * - 1 ) ; // If we get to this point then no translation exists or the default locale translation failed to be downloaded .
translatedTopic... |
public class PmiRegistry { /** * return the top level modules ' s PerfLevelDescriptor in String */
public static String getInstrumentationLevelString ( ) { } } | if ( disabled ) return null ; Map modules = moduleRoot . children ; if ( modules == null ) { return "" ; } else { PerfLevelDescriptor [ ] plds = new PerfLevelDescriptor [ modules . size ( ) ] ; Iterator values = modules . values ( ) . iterator ( ) ; int i = 0 ; while ( values . hasNext ( ) ) { PmiModule instance = ( ( ... |
public class CommerceAddressLocalServiceWrapper { /** * Deletes the commerce address from the database . Also notifies the appropriate model listeners .
* @ param commerceAddress the commerce address
* @ return the commerce address that was removed
* @ throws PortalException */
@ Override public com . liferay . c... | return _commerceAddressLocalService . deleteCommerceAddress ( commerceAddress ) ; |
public class SocialTemplate { /** * Property names for Facebook - Override to customize
* @ param props
* @ return */
protected SocialProfile parseProfile ( Map < String , Object > props ) { } } | if ( ! props . containsKey ( "id" ) ) { throw new IllegalArgumentException ( "No id in profile" ) ; } SocialProfile profile = SocialProfile . with ( props ) . displayName ( "name" ) . first ( "first_name" ) . last ( "last_name" ) . id ( "id" ) . username ( "username" ) . profileUrl ( "link" ) . build ( ) ; profile . se... |
public class SecurityUtils { /** * Creates a { @ link SSLConnectionSocketFactory } which is careless about SSL
* certificate checks . Use with caution !
* @ return */
@ SuppressWarnings ( "checkstyle:AbbreviationAsWordInName" ) public static SSLConnectionSocketFactory createUnsafeSSLConnectionSocketFactory ( ) { } ... | try { final SSLContextBuilder builder = new SSLContextBuilder ( ) ; builder . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) ) ; return new SSLConnectionSocketFactory ( builder . build ( ) , new NaiveHostnameVerifier ( ) ) ; } catch ( final Exception e ) { throw new IllegalStateException ( e ) ; } |
public class CommandLineTools { /** * Tags text using the LanguageTool tagger , printing results to System . out .
* @ param contents Text to tag .
* @ param lt LanguageTool instance */
public static void tagText ( String contents , JLanguageTool lt ) throws IOException { } } | AnalyzedSentence analyzedText ; List < String > sentences = lt . sentenceTokenize ( contents ) ; for ( String sentence : sentences ) { analyzedText = lt . getAnalyzedSentence ( sentence ) ; System . out . println ( analyzedText ) ; } |
public class ReportResourcesImpl { /** * Sets the publish status of a report and returns the new status , including the URLs of any
* enabled publishing .
* It mirrors to the following Smartsheet REST API method : PUT / reports / { id } / publish
* Exceptions :
* - InvalidRequestException : if there is any prob... | return this . updateResource ( "reports/" + id + "/publish" , ReportPublish . class , reportPublish ) ; |
public class DescribeWorkingStorageResult { /** * An array of the gateway ' s local disk IDs that are configured as working storage . Each local disk ID is specified
* as a string ( minimum length of 1 and maximum length of 300 ) . If no local disks are configured as working storage ,
* then the DiskIds array is em... | if ( this . diskIds == null ) { setDiskIds ( new com . amazonaws . internal . SdkInternalList < String > ( diskIds . length ) ) ; } for ( String ele : diskIds ) { this . diskIds . add ( ele ) ; } return this ; |
public class IdentifierToken { /** * Update the value represented by this token on the given object < code > object < / code > with
* the value < code > value < / code > .
* @ param object the object to update
* @ param value the new value */
public void write ( Object object , Object value ) { } } | if ( object == null ) { String msg = "Can not update the identifier \"" + _identifier + "\" on a null value object." ; LOGGER . error ( msg ) ; throw new RuntimeException ( msg ) ; } if ( TRACE_ENABLED ) LOGGER . trace ( "Update property named \"" + _identifier + "\" on object of type: \"" + object . getClass ( ) . get... |
public class Input { /** * Get the name of the axis with the given index
* @ param controller The index of the controller to check
* @ param axis The index of the axis to read
* @ return The name of the specified axis */
public String getAxisName ( int controller , int axis ) { } } | return ( ( Controller ) controllers . get ( controller ) ) . getAxisName ( axis ) ; |
public class PersistentTimerTaskHandler { /** * Retrieves the application specified information that is to be
* delivered along with the Timer task expiration . A new copy of
* the serializable object is returned every time . < p >
* Note : the info object may be returned ( or null ) even if the application
* h... | if ( userInfoBytes == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getUserInfo: null" ) ; return null ; } Serializable userInfo = null ; try { // Use timer application ClassLoader if installed ; otherwise use current thread context ClassLoader
ClassLoader loader... |
public class HtmlInput { /** * Capture events that occur anywhere on the page .
* Note that event values will be relative to the page ( not the
* rootElement ) { @ see # getRelativeX ( NativeEvent , Element ) } and { @ see
* # getRelativeY ( NativeEvent , Element ) } . */
static void capturePageEvent ( String eve... | HtmlPlatform . captureEvent ( eventName , new EventHandler ( ) { @ Override public void handleEvent ( NativeEvent evt ) { handler . handleEvent ( evt ) ; } } ) ; |
public class InternalTransaction { /** * Perform a number of additions , optimistic replace updates and deletes of
* ManagedOjects but writes and single log record with a list of objects to replace .
* Optimistic replace does not required the ManagedObject to be in locked state ,
* it can be in Added , Locked , R... | final String methodName = "optimisticReplace" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { managedObjectsToAdd , managedObjectsToReplace , managedObjectsToDelete , tokensToNotify , transaction , new Long ( logSpaceReservedDelta ) ... |
public class CdnClient { /** * Set HTTPS with certain configuration .
* @ param domain Name of the domain .
* @ param https The configuration of HTTPS . */
public void setHttpsConfig ( String domain , HttpsConfig https ) { } } | SetHttpsConfigRequest request = new SetHttpsConfigRequest ( ) . withDomain ( domain ) . withHttps ( https ) ; setHttpsConfig ( request ) ; |
public class FactoryInterestPointAlgs { /** * Creates a SIFT detector */
public static SiftDetector sift ( @ Nullable ConfigSiftScaleSpace configSS , @ Nullable ConfigSiftDetector configDetector ) { } } | if ( configSS == null ) configSS = new ConfigSiftScaleSpace ( ) ; if ( configDetector == null ) configDetector = new ConfigSiftDetector ( ) ; NonMaxLimiter nonmax = FactoryFeatureExtractor . nonmaxLimiter ( configDetector . extract , configDetector . maxFeaturesPerScale ) ; SiftScaleSpace ss = new SiftScaleSpace ( conf... |
public class Alignments { /** * Return the gaps in the specified gapped symbol list as 0 - based [ closed , open ) ranges .
* @ param gappedSymbols gapped symbol list , must not be null
* @ return the gaps in the specified gapped symbol list as 0 - based [ closed , open ) ranges */
public static List < Range < Long... | checkNotNull ( gappedSymbols ) ; List < Range < Long > > gaps = new ArrayList < Range < Long > > ( ) ; int gapStart = - 1 ; for ( int i = 1 , length = gappedSymbols . length ( ) + 1 ; i < length ; i ++ ) { if ( isGapSymbol ( gappedSymbols . symbolAt ( i ) ) ) { if ( gapStart < 0 ) { gapStart = i ; } } else { if ( gapSt... |
public class GSMPImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSMP__PREC : setPREC ( PREC_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class CPInstancePersistenceImpl { /** * Returns a range of all the cp instances where companyId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the r... | return findByCompanyId ( companyId , start , end , null ) ; |
public class MatchPatternIterator { /** * Initialize the context values for this expression
* after it is cloned .
* @ param context The XPath runtime context for this
* transformation . */
public void setRoot ( int context , Object environment ) { } } | super . setRoot ( context , environment ) ; m_traverser = m_cdtm . getAxisTraverser ( m_superAxis ) ; |
public class InmemQueue { /** * Puts a message to the queue buffer .
* @ param msg
* @ throws QueueException . QueueIsFull
* if the ring buffer is full */
protected void putToQueue ( IQueueMessage < ID , DATA > msg ) throws QueueException . QueueIsFull { } } | if ( ! queue . offer ( msg ) ) { throw new QueueException . QueueIsFull ( getBoundary ( ) ) ; } |
public class BaseBigtableTableAdminClient { /** * Lists all snapshots associated with the specified cluster .
* < p > Note : This is a private alpha release of Cloud Bigtable snapshots . This feature is not
* currently available to most Cloud Bigtable customers . This feature might be changed in
* backward - inco... | ListSnapshotsRequest request = ListSnapshotsRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return listSnapshots ( request ) ; |
public class FacesServlet { /** * < p > Acquire the factory instances we will require . < / p >
* @ throws ServletException if , for any reason , the startup of
* this Faces application failed . This includes errors in the
* config file that is parsed before or during the processing of
* this < code > init ( ) ... | // Save our ServletConfig instance
this . servletConfig = servletConfig ; // Acquire our FacesContextFactory instance
try { facesContextFactory = ( FacesContextFactory ) FactoryFinder . getFactory ( FactoryFinder . FACES_CONTEXT_FACTORY ) ; } catch ( FacesException e ) { ResourceBundle rb = LOGGER . getResourceBundle (... |
public class ElementPlugin { /** * Forward command events to first level children of the container .
* @ param event The command event . */
@ EventHandler ( "command" ) private void onCommand ( CommandEvent event ) { } } | if ( isEnabled ( ) ) { for ( BaseComponent child : container . getChildren ( ) ) { EventUtil . send ( event , child ) ; if ( event . isStopped ( ) ) { break ; } } } |
public class RelativeToEasterSundayParser { /** * Parses relative to Easter Sunday holidays . */
public void parse ( final int nYear , final HolidayMap aHolidayMap , final Holidays aConfig ) { } } | for ( final RelativeToEasterSunday aDay : aConfig . getRelativeToEasterSunday ( ) ) { if ( ! isValid ( aDay , nYear ) ) continue ; final ChronoLocalDate aEasterSunday = getEasterSunday ( nYear , aDay . getChronology ( ) ) ; aEasterSunday . plus ( aDay . getDays ( ) , ChronoUnit . DAYS ) ; final String sPropertiesKey = ... |
public class PushGateway { /** * Deletes metrics from the Pushgateway .
* This uses the DELETE HTTP method .
* @ deprecated use { @ link # delete ( String , Map ) } */
@ Deprecated public void delete ( String job , String instance ) throws IOException { } } | delete ( job , Collections . singletonMap ( "instance" , instance ) ) ; |
public class JaxbSerializer { /** * { @ inheritDoc } */
@ Override public ByteBuffer toByteBuffer ( Object obj ) { } } | if ( obj == null ) { return null ; } ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; try { XMLStreamWriter writer = createStreamWriter ( buffer ) ; marshaller . get ( ) . marshal ( obj , writer ) ; writer . flush ( ) ; writer . close ( ) ; } catch ( JAXBException e ) { throw new HectorSerializationExcept... |
public class CompoundObjectType { /** * Answer a list of types of this CompoundObjectType .
* @ param noAbstractTypes if true , no abstract types and no interfaces are answered ,
* else all types of the CompoundObjectType are answered .
* @ return a list of java Classes */
public List < Class < ? > > getTypes ( b... | List < Class < ? > > typeList = new ArrayList < Class < ? > > ( ) ; this . addType ( typeList , noAbstractTypes ) ; return typeList ; |
public class SearchTransitGatewayRoutesResult { /** * Information about the routes .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRoutes ( java . util . Collection ) } or { @ link # withRoutes ( java . util . Collection ) } if you want to override the
... | if ( this . routes == null ) { setRoutes ( new com . amazonaws . internal . SdkInternalList < TransitGatewayRoute > ( routes . length ) ) ; } for ( TransitGatewayRoute ele : routes ) { this . routes . add ( ele ) ; } return this ; |
public class DefaultArtifactoryClient { /** * / / / / / Helpers */
private ResponseEntity < String > makeRestCall ( String instanceUrl , String suffix ) { } } | ResponseEntity < String > response = null ; try { response = restOperations . exchange ( joinUrl ( instanceUrl , artifactorySettings . getEndpoint ( ) , suffix ) , HttpMethod . GET , new HttpEntity < > ( createHeaders ( instanceUrl ) ) , String . class ) ; } catch ( RestClientException re ) { LOGGER . error ( "Error wi... |
public class CmsSolrQuery { /** * Sets the text . < p >
* @ param text the text to set */
public void setText ( String text ) { } } | m_text = text ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( text ) ) { setQuery ( createTextQuery ( text ) ) ; } |
public class CoreSynonymDictionaryEx { /** * 将分词结果转换为同义词列表
* @ param sentence 句子
* @ param withUndefinedItem 是否保留词典中没有的词语
* @ return */
public static List < Long [ ] > convert ( List < Term > sentence , boolean withUndefinedItem ) { } } | List < Long [ ] > synonymItemList = new ArrayList < Long [ ] > ( sentence . size ( ) ) ; for ( Term term : sentence ) { // 除掉停用词
if ( term . nature == null ) continue ; String nature = term . nature . toString ( ) ; char firstChar = nature . charAt ( 0 ) ; switch ( firstChar ) { case 'm' : { if ( ! TextUtility . isAllC... |
public class Element { /** * Search for the attribute " id " and return the value .
* @ return the id of this element or null when not found */
public String getElementId ( ) { } } | for ( Entry < String , String > attribute : attributes . entrySet ( ) ) { if ( attribute . getKey ( ) . equalsIgnoreCase ( "id" ) ) { return attribute . getValue ( ) ; } } return null ; |
public class ComponentAccess { /** * Call an method by Annotation .
* @ param o the object to call .
* @ param ann the annotation
* @ param lazy if true , the a missing annotation is OK . if false
* the annotation has to be present or a Runtime exception is thrown . */
public static void callAnnotated ( Object ... | try { getMethodOfInterest ( o , ann ) . invoke ( o ) ; } catch ( IllegalAccessException ex ) { throw new RuntimeException ( ex ) ; } catch ( InvocationTargetException ex ) { throw new RuntimeException ( ex . getCause ( ) ) ; } catch ( IllegalArgumentException ex ) { if ( ! lazy ) { throw new RuntimeException ( ex . get... |
public class HttpObjectEncoder { /** * Writes an { @ link HttpData } . */
public final ChannelFuture writeData ( int id , int streamId , HttpData data , boolean endStream ) { } } | assert eventLoop ( ) . inEventLoop ( ) ; if ( closed ) { ReferenceCountUtil . safeRelease ( data ) ; return newClosedSessionFuture ( ) ; } return doWriteData ( id , streamId , data , endStream ) ; |
public class ViewDragHelper { /** * Check if we ' ve crossed a reasonable touch slop for the given child view .
* If the child cannot be dragged along the horizontal or vertical axis , motion
* along that axis will not count toward the slop check .
* @ param child Child to check
* @ param dx Motion since initia... | if ( child == null ) { return false ; } final boolean checkHorizontal = mCallback . getViewHorizontalDragRange ( child ) > 0 ; final boolean checkVertical = mCallback . getViewVerticalDragRange ( child ) > 0 ; if ( checkHorizontal && checkVertical ) { return dx * dx + dy * dy > mTouchSlop * mTouchSlop ; } else if ( che... |
public class OffsetDateTime { /** * Returns a copy of this { @ code OffsetDateTime } with the specified number of days subtracted .
* This method subtracts the specified amount from the days field decrementing the
* month and year fields as necessary to ensure the result remains valid .
* The result is only inval... | return ( days == Long . MIN_VALUE ? plusDays ( Long . MAX_VALUE ) . plusDays ( 1 ) : plusDays ( - days ) ) ; |
public class BogusExceptionDeclaration { /** * implements the visitor to see if the method declares that it throws any checked exceptions .
* @ param obj
* the context object of the currently parsed code block */
@ Override public void visitCode ( Code obj ) { } } | Method method = getMethod ( ) ; if ( method . isSynthetic ( ) ) { return ; } declaredCheckedExceptions . clear ( ) ; stack . resetForMethodEntry ( this ) ; ExceptionTable et = method . getExceptionTable ( ) ; if ( et != null ) { if ( classIsFinal || classIsAnonymous || method . isStatic ( ) || method . isPrivate ( ) ||... |
public class ShellCommand { /** * @ Override
* protected void initBootOptions ( )
* super . initBootOptions ( ) ;
* addValueOption ( " input " , " FILE " , " input script " ) . tiny ( " i " ) ; */
@ Override public ExitCode doCommandImpl ( ArgsBase args ) // , ConfigBoot resinBoot )
throws CommandLineException { ... | Console console = System . console ( ) ; /* if ( args . env ( ) . isEmbedded ( ) ) {
console = null ; */
String fileName = args . getArg ( "input" ) ; if ( fileName != null ) { throw new UnsupportedOperationException ( ) ; /* PathImpl pwd = VfsOld . getPwd ( ) ;
PathImpl scriptPath = VfsOld . lookup ( fileName ) ; ... |
public class Asm { /** * Create qword ( 8 Bytes ) pointer operand . */
public static final Mem qword_ptr_abs ( long target , Register index , int shift , long disp , SEGMENT segmentPrefix ) { } } | return _ptr_build_abs ( target , index , shift , disp , segmentPrefix , SIZE_QWORD ) ; |
public class HashtableOnDisk { /** * Write the object pointer to the table . If we are in the process of
* doubling , this method finds the correct table to update ( since there are
* two tables active during the doubling process ) . */
void updateHtindex ( int index , long value , int tableid ) { } } | if ( tableid == header . currentTableId ( ) ) { htindex [ index ] = value ; } else { new_htindex [ index ] = value ; } |
public class Delta { /** * Undo differential coding ( in - place ) . Effectively computes a prefix
* sum . Like inverseDelta , only faster .
* @ param data
* to be modified */
public static void fastinverseDelta ( int [ ] data ) { } } | int sz0 = data . length / 4 * 4 ; int i = 1 ; if ( sz0 >= 4 ) { int a = data [ 0 ] ; for ( ; i < sz0 - 4 ; i += 4 ) { a = data [ i ] += a ; a = data [ i + 1 ] += a ; a = data [ i + 2 ] += a ; a = data [ i + 3 ] += a ; } } for ( ; i != data . length ; ++ i ) { data [ i ] += data [ i - 1 ] ; } |
public class Transaction { /** * Returns the result set from the provided query . Holds a pessimistic lock on all returned
* documents .
* @ return The contents of the Document at this DocumentReference . */
@ Nonnull public ApiFuture < QuerySnapshot > get ( @ Nonnull Query query ) { } } | Preconditions . checkState ( isEmpty ( ) , READ_BEFORE_WRITE_ERROR_MSG ) ; return query . get ( transactionId ) ; |
public class FileHandler { /** * javadoc . */
private void configure ( ) { } } | LogManager manager = LogManager . getLogManager ( ) ; String cname = getClass ( ) . getName ( ) ; pattern = manager . getStringProperty ( cname + ".pattern" , "%h/java%u.log" ) ; limit = manager . getIntProperty ( cname + ".limit" , 0 ) ; if ( limit < 0 ) { limit = 0 ; } count = manager . getIntProperty ( cname + ".cou... |
public class CheckMoveHandler { /** * The Field has Changed .
* @ param bDisplayOption If true , display the change .
* @ param iMoveMode The type of move being done ( init / read / screen ) .
* @ return The error code ( or NORMAL _ RETURN if okay ) . */
public int moveIt ( boolean bDisplayOption , int iMoveMode ... | ( ( BaseField ) m_fldDest . getField ( ) ) . setEnabled ( ! this . getOwner ( ) . getState ( ) ) ; if ( iMoveMode != DBConstants . SCREEN_MOVE ) return DBConstants . NORMAL_RETURN ; if ( this . getOwner ( ) . getState ( ) == false ) { if ( bDisplayOption ) ( ( BaseField ) m_fldDest . getField ( ) ) . displayField ( ) ;... |
public class SARLAnnotationUtil { /** * Extract the integer value of the given annotation , if it exists .
* @ param op the annotated element .
* @ param annotationType the type of the annotation to consider
* @ return the value of the annotation , or { @ code null } if no annotation or no
* value .
* @ since... | final JvmAnnotationReference reference = this . lookup . findAnnotation ( op , annotationType ) ; if ( reference != null ) { return findIntValue ( reference ) ; } return null ; |
import java . util . regex . Pattern ; class EliminateExtraSpaces { /** * This function replaces multiple spaces in a string with a single space using regular expressions .
* Examples :
* > > > eliminate _ extra _ spaces ( ' Google Assistant ' )
* ' Google Assistant '
* > > > eliminate _ extra _ spaces ( ' Quad... | Pattern multipleSpaces = Pattern . compile ( "\\s+" ) ; return multipleSpaces . matcher ( inputText ) . replaceAll ( " " ) ; |
public class MetricRegistryImpl { /** * Return the { @ link Counter } registered under this name ; or create and register
* a new { @ link Counter } if none is registered .
* @ param name the name of the metric
* @ return a new or pre - existing { @ link Counter } */
@ Override public Counter counter ( String nam... | return this . counter ( new Metadata ( name , MetricType . COUNTER ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSweptDiskSolid ( ) { } } | if ( ifcSweptDiskSolidEClass == null ) { ifcSweptDiskSolidEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 586 ) ; } return ifcSweptDiskSolidEClass ; |
public class AWSRAMClient { /** * Gets the policies for the specifies resources .
* @ param getResourcePoliciesRequest
* @ return Result of the GetResourcePolicies operation returned by the service .
* @ throws MalformedArnException
* The format of an Amazon Resource Name ( ARN ) is not valid .
* @ throws Inv... | request = beforeClientExecution ( request ) ; return executeGetResourcePolicies ( request ) ; |
public class AmazonWorkLinkClient { /** * Updates fleet metadata , such as DisplayName .
* @ param updateFleetMetadataRequest
* @ return Result of the UpdateFleetMetadata operation returned by the service .
* @ throws UnauthorizedException
* You are not authorized to perform this action .
* @ throws InternalS... | request = beforeClientExecution ( request ) ; return executeUpdateFleetMetadata ( request ) ; |
public class PluginService { /** * Returns the set of plugins with the given query parameters .
* @ param queryParams The query parameters
* @ return The set of plugins */
public Collection < Plugin > list ( List < String > queryParams ) { } } | return HTTP . GET ( "/v2/plugins.json" , null , queryParams , PLUGINS ) . get ( ) ; |
public class Graphs { /** * Returns a synchronized ( thread - safe ) { @ link UndirectedGraph } backed by the specified Graph .
* It is imperative that the user manually synchronize on the returned graph when iterating over iterable collections :
* < pre >
* Graph syncGraph = synchronize ( graph ) ;
* synchroni... | UndirectedGraph < V , E > checkedGraph = checkNotNull ( graph , "Impossible to synchronize null Graph." ) ; return new SynchronizedUndirectedGraph < V , E > ( checkedGraph ) ; |
public class PdfContentByte { /** * Implements a link to another document .
* @ param filename the filename for the remote document
* @ param name the name to jump to
* @ param llx the lower left x corner of the activation area
* @ param lly the lower left y corner of the activation area
* @ param urx the upp... | pdf . remoteGoto ( filename , name , llx , lly , urx , ury ) ; |
public class ObservableHttp { /** * Execute request using { @ link HttpAsyncRequestProducer } to define HTTP Method , URI and payload ( if applicable ) .
* If the response is chunked ( or flushed progressively such as with < i > text / event - stream < / i > < a href = " http : / / www . w3 . org / TR / 2009 / WD - e... | return createRequest ( requestProducer , client , new BasicHttpContext ( ) ) ; |
public class JSONDeserializer { /** * Parses the JSON string and returns the IJSONSerializable .
* Use this method if you need to parse JSON that may contain one or more errors .
* < pre >
* ValidationContext ctx = new ValidationContext ( ) ;
* ctx . setValidate ( true ) ;
* ctx . setStopOnError ( false ) ; /... | try { ctx . push ( "fromString" ) ; if ( null == ( string = StringOps . toTrimOrNull ( string ) ) ) { ctx . addError ( "NULL JSON String" ) ; return null ; } final JSONValue value = JSONParser . parseStrict ( string ) ; if ( null == value ) { ctx . addError ( "NULL from JSONParser" ) ; return null ; } final JSONObject ... |
public class FileUtils { /** * Loads a list of { @ link Symbol } s from a file , one - per - line , skipping lines starting with " # " as
* comments . */
public static ImmutableList < Symbol > loadSymbolList ( final CharSource source ) throws IOException { } } | return SymbolUtils . listFrom ( loadStringList ( source ) ) ; |
public class MalisisGui { /** * Display this { @ link MalisisGui } .
* @ param cancelClose the wether or not to cancel the next Gui close event ( used for when the GUI is opened from command ) */
public void display ( boolean cancelClose ) { } } | setResolution ( ) ; if ( ! doConstruct ( ) ) return ; MalisisGui . cancelClose = cancelClose ; Minecraft . getMinecraft ( ) . displayGuiScreen ( this ) ; |
public class AbstractLocalAlluxioCluster { /** * Configures and starts the worker ( s ) . */
public void startWorkers ( ) throws Exception { } } | mWorkers = new ArrayList < > ( ) ; for ( int i = 0 ; i < mNumWorkers ; i ++ ) { mWorkers . add ( WorkerProcess . Factory . create ( ) ) ; } for ( final WorkerProcess worker : mWorkers ) { Runnable runWorker = ( ) -> { try { worker . start ( ) ; } catch ( InterruptedException e ) { // this is expected
} catch ( Exceptio... |
public class ValidationResultList { /** * Count all items according to the provided filter .
* @ param aFilter
* Optional filter to use . May be < code > null < / code > .
* @ return The number of errors matching the provided filter . */
@ Nonnegative public int getAllCount ( @ Nullable final Predicate < ? super ... | int ret = 0 ; for ( final ValidationResult aItem : this ) ret += aItem . getErrorList ( ) . getCount ( aFilter ) ; return ret ; |
public class SbeTool { /** * Generate SBE encoding and decoding stubs for a target language .
* @ param ir for the parsed specification .
* @ param outputDirName directory into which code will be generated .
* @ param targetLanguage for the generated code .
* @ throws Exception if an error occurs while generati... | final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader . get ( targetLanguage ) ; final CodeGenerator codeGenerator = targetCodeGenerator . newInstance ( ir , outputDirName ) ; codeGenerator . generate ( ) ; |
public class LocalSession { /** * Called from producers when sending a message
* @ param message message to dispatch
* @ throws JMSException */
public final void dispatch ( AbstractMessage message ) throws JMSException { } } | // Security
LocalConnection conn = ( LocalConnection ) getConnection ( ) ; if ( conn . isSecurityEnabled ( ) ) { Destination destination = message . getJMSDestination ( ) ; if ( destination instanceof Queue ) { String queueName = ( ( Queue ) destination ) . getQueueName ( ) ; if ( conn . isRegisteredTemporaryQueue ( qu... |
public class AWSCodePipelineClient { /** * Represents the success of a job as returned to the pipeline by a job worker . Only used for custom actions .
* @ param putJobSuccessResultRequest
* Represents the input of a PutJobSuccessResult action .
* @ return Result of the PutJobSuccessResult operation returned by t... | request = beforeClientExecution ( request ) ; return executePutJobSuccessResult ( request ) ; |
public class AbstractListPreference { /** * Sets the values , which correspond to the entries of the list , which is shown by the
* preference .
* @ param entryValues
* The values , which should be set , as a { @ link CharSequence } array . The values may not
* be null and the array ' s length must be equal to ... | Condition . INSTANCE . ensureNotNull ( entryValues , "The entry values may not be null" ) ; this . entryValues = entryValues ; |
public class AbstractActivityContextBuilder { /** * Initialize the aspect rule registry .
* @ param assistant the context rule assistant */
private void initAspectRuleRegistry ( ContextRuleAssistant assistant ) { } } | AspectRuleRegistry aspectRuleRegistry = assistant . getAspectRuleRegistry ( ) ; BeanRuleRegistry beanRuleRegistry = assistant . getBeanRuleRegistry ( ) ; TransletRuleRegistry transletRuleRegistry = assistant . getTransletRuleRegistry ( ) ; AspectAdviceRulePostRegister sessionScopeAspectAdviceRulePostRegister = new Aspe... |
public class BootstrapContextImpl { /** * Instantiate a new ResourceAdapter and set each < config - property > on it .
* @ return configured resource adapter .
* @ throws Exception if an error occurs during configuration and onError = FAIL */
@ FFDCIgnore ( value = { } } | NumberFormatException . class , Throwable . class } ) private ResourceAdapter configureResourceAdapter ( ) throws Exception { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; String resourceAdapterClassName = ( String ) properties . get ( RESOURCE_ADAPTER_CLASS ) ; if ( resourceAdapterClassName == null ... |
public class MeasureToViewMap { /** * Returns the subset of the given views that should be exported */
private static Set < View > filterExportedViews ( Collection < View > allViews ) { } } | Set < View > views = Sets . newHashSet ( ) ; for ( View view : allViews ) { if ( view . getWindow ( ) instanceof View . AggregationWindow . Cumulative ) { views . add ( view ) ; } } return Collections . unmodifiableSet ( views ) ; |
public class StyleUtils { /** * 设置run的样式
* @ param run
* @ param style */
public static void styleRun ( XWPFRun run , Style style ) { } } | if ( null == run || null == style ) return ; String color = style . getColor ( ) ; String fontFamily = style . getFontFamily ( ) ; int fontSize = style . getFontSize ( ) ; Boolean bold = style . isBold ( ) ; Boolean italic = style . isItalic ( ) ; Boolean strike = style . isStrike ( ) ; Boolean underLine = style . isUn... |
public class CmsLocaleManager { /** * Clears the caches in the locale manager . < p > */
private void clearCaches ( ) { } } | // flush all caches
OpenCms . getMemoryMonitor ( ) . flushCache ( CmsMemoryMonitor . CacheType . LOCALE ) ; CmsResourceBundleLoader . flushBundleCache ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_LOCALE_MANAGER_FLUSH_CACHE_1 , "EVENT_CLEAR_CACHES" ) ) ;... |
public class SnapshotUtil { /** * Write the hashinator config file for a snapshot
* @ param instId instance ID
* @ param path path to which snapshot files will be written
* @ param nonce nonce used to distinguish this snapshot
* @ param hostId host ID where this is happening
* @ param hashData serialized hash... | final File file = new VoltFile ( path , constructHashinatorConfigFilenameForNonce ( nonce , hostId ) ) ; if ( file . exists ( ) ) { if ( ! file . delete ( ) ) { if ( isTruncationSnapshot ) { VoltDB . crashLocalVoltDB ( "Unexpected exception while attempting to delete old hash file for truncation snapshot" ) ; } throw n... |
public class EnvironmentPropertiesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EnvironmentProperties environmentProperties , ProtocolMarshaller protocolMarshaller ) { } } | if ( environmentProperties == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( environmentProperties . getPropertyGroups ( ) , PROPERTYGROUPS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ... |
public class LongList { /** * This is equivalent to :
* < pre >
* < code >
* if ( isEmpty ( ) ) {
* return OptionalLong . empty ( ) ;
* long result = elementData [ 0 ] ;
* for ( int i = 1 ; i < size ; i + + ) {
* result = accumulator . applyAsLong ( result , elementData [ i ] ) ;
* return OptionalLong .... | if ( isEmpty ( ) ) { return OptionalLong . empty ( ) ; } long result = elementData [ 0 ] ; for ( int i = 1 ; i < size ; i ++ ) { result = accumulator . applyAsLong ( result , elementData [ i ] ) ; } return OptionalLong . of ( result ) ; |
public class EncodingSchemeIDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . ENCODING_SCHEME_ID__ESID_CP : setESidCP ( ( Integer ) newValue ) ; return ; case AfplibPackage . ENCODING_SCHEME_ID__ESID_UD : setESidUD ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class XMLRoadUtil { /** * Read a road from the XML description .
* @ param element is the XML node to read .
* @ param pathBuilder is the tool to make paths absolute .
* @ param resources is the tool that permits to gather the resources .
* @ return the road .
* @ throws IOException in case of error . ... | return readRoadPolyline ( element , pathBuilder , resources ) ; |
public class MultipartFormData { /** * 加入普通参数
* @ param name 参数名
* @ param value 参数值 */
private void putParameter ( String name , String value ) { } } | String [ ] params = requestParameters . get ( name ) ; params = params == null ? new String [ ] { value } : ArrayUtil . append ( params , value ) ; requestParameters . put ( name , params ) ; |
public class Basic2DMatrix { /** * Creates a random { @ link Basic2DMatrix } of the given shape :
* { @ code rows } x { @ code columns } . */
public static Basic2DMatrix random ( int rows , int columns , Random random ) { } } | double [ ] [ ] array = new double [ rows ] [ columns ] ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < columns ; j ++ ) { array [ i ] [ j ] = random . nextDouble ( ) ; } } return new Basic2DMatrix ( array ) ; |
public class Dim { /** * Evaluates the given script . */
public void evalScript ( final String url , final String text ) { } } | DimIProxy action = new DimIProxy ( this , IPROXY_EVAL_SCRIPT ) ; action . url = url ; action . text = text ; action . withContext ( ) ; |
public class JournalKelpImpl { /** * Writes the put to the journal . */
void put ( RowCursor cursor ) { } } | boolean isValid ; do { isValid = true ; try ( JournalOutputStream os = openItem ( ) ) { os . write ( CODE_PUT ) ; cursor . writeJournal ( os ) ; isValid = os . complete ( ) ; } catch ( IOException e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } } while ( ! isValid ) ; |
public class AbstractHostPartitionConnectionPool { /** * Add host to the system . May need to rebuild the partition map of the system
* @ param host
* @ param refresh */
@ Override public final synchronized boolean addHost ( Host host , boolean refresh ) { } } | // Already exists
if ( hosts . containsKey ( host ) ) { // Check to see if we are adding token ranges or if the token ranges changed
// which will force a rebuild of the token topology
Host existingHost = hosts . get ( host ) . getHost ( ) ; if ( existingHost . getTokenRanges ( ) . size ( ) != host . getTokenRanges ( )... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getPGD ( ) { } } | if ( pgdEClass == null ) { pgdEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 312 ) ; } return pgdEClass ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.