signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class XmlReader { /** * httpContentType is NULL */
private static String getContentTypeEncoding ( final String httpContentType ) { } } | String encoding = null ; if ( httpContentType != null ) { final int i = httpContentType . indexOf ( ";" ) ; if ( i > - 1 ) { final String postMime = httpContentType . substring ( i + 1 ) ; final Matcher m = CHARSET_PATTERN . matcher ( postMime ) ; if ( m . find ( ) ) { encoding = m . group ( 1 ) ; } if ( encoding != nu... |
public class ColumnBlob { /** * Copies the inline blob from a source block to a destination block .
* If the inline blob is too large for the target block , return - 1,
* otherwise return the new blobTail . */
@ Override int insertBlob ( byte [ ] srcBuffer , int srcRowOffset , byte [ ] dstBuffer , int dstRowOffset ... | int srcColumnOffset = srcRowOffset + offset ( ) ; int dstColumnOffset = dstRowOffset + offset ( ) ; int blobLen = BitsUtil . readInt16 ( srcBuffer , srcColumnOffset + 2 ) ; if ( blobLen == 0 ) { return dstBlobTail ; } blobLen &= ~ LARGE_BLOB_MASK ; if ( dstRowOffset < dstBlobTail + blobLen ) { return - 1 ; } int blobOf... |
public class RemoteQueueBrowserEnumeration { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . common . session . AbstractQueueBrowserEnumeration # onQueueBrowserEnumerationClose ( ) */
@ Override protected void onQueueBrowserEnumerationClose ( ) { } } | try { CloseBrowserEnumerationQuery query = new CloseBrowserEnumerationQuery ( ) ; query . setSessionId ( session . getId ( ) ) ; query . setBrowserId ( browser . getId ( ) ) ; query . setEnumId ( id ) ; transportEndpoint . blockingRequest ( query ) ; } catch ( JMSException e ) { ErrorTools . log ( e , log ) ; } |
public class LogFactory { /** * 决定日志实现
* 依次按照顺序检查日志库的jar是否被引入 , 如果未引入任何日志库 , 则检查ClassPath下的logging . properties , 存在则使用JdkLogFactory , 否则使用ConsoleLogFactory
* @ see Slf4jLogFactory
* @ see Log4j2LogFactory
* @ see Log4jLogFactory
* @ see ApacheCommonsLogFactory
* @ see TinyLogFactory
* @ see JbossLogFacto... | final LogFactory factory = doCreate ( ) ; factory . getLog ( LogFactory . class ) . debug ( "Use [{}] Logger As Default." , factory . name ) ; return factory ; |
public class AptUtils { /** * Returns the values of an annotation ' s attributes , including defaults .
* The method with the same name in JavacElements cannot be used directly ,
* because it includes a cast to Attribute . Compound , which doesn ' t hold
* for annotations generated by the Checker Framework .
* ... | Map < ExecutableElement , AnnotationValue > valMap = Optional . ofNullable ( ( Map < ExecutableElement , AnnotationValue > ) annotMirror . getElementValues ( ) ) . map ( x -> new HashMap < > ( x ) ) . orElse ( new HashMap < > ( ) ) ; ElementFilter . methodsIn ( annotMirror . getAnnotationType ( ) . asElement ( ) . getE... |
public class StaxUtils { /** * Return a new factory so that the caller can set sticky parameters .
* @ param nsAware
* @ throws XMLStreamException */
@ FFDCIgnore ( Throwable . class ) public static XMLInputFactory createXMLInputFactory ( boolean nsAware ) { } } | XMLInputFactory factory = null ; try { factory = XMLInputFactory . newInstance ( ) ; } catch ( Throwable t ) { if ( LOG . isLoggable ( Level . FINE ) ) { LOG . log ( Level . FINE , "XMLInputFactory.newInstance() failed with: " , t ) ; } factory = null ; } if ( factory == null || ! setRestrictionProperties ( factory ) )... |
public class ChangelogUtil { /** * Add an index on the given collection and field
* @ param collection the collection to use for the index
* @ param field the field to use for the index
* @ param asc the sorting direction . < code > true < / code > to sort ascending ; < code > false < / code > to sort descending ... | int dir = ( asc ) ? 1 : - 1 ; collection . createIndex ( new BasicDBObject ( field , dir ) , new BasicDBObject ( "background" , background ) ) ; |
public class GalleryImagesInner { /** * List gallery images in a given lab account .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; GalleryImage... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < GalleryImageInner > > , Page < GalleryImageInner > > ( ) { @ Override public Page < GalleryImageInner > call ( ServiceResponse < Page < GalleryImageInner > > response ) { return response . body ( ) ; } } ) ; |
public class CQLTransaction { /** * Execute a batch statement that applies all updates in this transaction . */
private void applyUpdates ( DBTransaction transaction ) { } } | if ( transaction . getMutationsCount ( ) == 0 ) { m_logger . debug ( "Skipping commit with no updates" ) ; } else if ( m_dbservice . getParamBoolean ( "async_updates" ) ) { executeUpdatesAsynchronous ( transaction ) ; } else { executeUpdatesSynchronous ( transaction ) ; } |
public class RealWebSocket { /** * For testing : force this web socket to release its threads . */
void tearDown ( ) throws InterruptedException { } } | if ( cancelFuture != null ) { cancelFuture . cancel ( false ) ; } executor . shutdown ( ) ; executor . awaitTermination ( 10 , TimeUnit . SECONDS ) ; |
public class XmlUtils { /** * Format an XML { @ link Source } to a pretty - printable { @ link StreamResult } .
* @ param input
* The ( unformatted ) input XML { @ link Source } .
* @ return The formatted { @ link StreamResult } . */
public static void format ( final Source input , final Result output ) { } } | try { // Use an identity transformation to write the source to the result .
final Transformer transformer = createTransformer ( null ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; transformer . transform ( input , output ) ; } catch ( final Exception ex ) { LOGGER . error ( "Problem formatting DO... |
public class ReferencePrefetcher { /** * Associate the batched Children with their owner object .
* Loop over owners */
protected void associateBatched ( Collection owners , Collection children ) { } } | ObjectReferenceDescriptor ord = getObjectReferenceDescriptor ( ) ; ClassDescriptor cld = getOwnerClassDescriptor ( ) ; Object owner ; Object relatedObject ; Object fkValues [ ] ; Identity id ; PersistenceBroker pb = getBroker ( ) ; PersistentField field = ord . getPersistentField ( ) ; Class topLevelClass = pb . getTop... |
public class BasicBinder { /** * Resolve an UnMarshaller with the given source and target class .
* The unmarshaller is used as follows : Instances of the source can be marshalled into the target class .
* @ param key The key to look up */
public < S , T > FromUnmarshaller < S , T > findUnmarshaller ( ConverterKey ... | Converter < T , S > converter = findConverter ( key . invert ( ) ) ; if ( converter == null ) { return null ; } if ( FromUnmarshallerConverter . class . isAssignableFrom ( converter . getClass ( ) ) ) { return ( ( FromUnmarshallerConverter < S , T > ) converter ) . getUnmarshaller ( ) ; } else { return new ConverterFro... |
public class ExtensionLoader { /** * 返回缺省的扩展 , 如果没有设置则返回 < code > null < / code > */
public T getDefaultExtension ( ) { } } | getExtensionClasses ( ) ; if ( null == cachedDefaultName || cachedDefaultName . length ( ) == 0 || "true" . equals ( cachedDefaultName ) ) { return null ; } return getExtension ( cachedDefaultName ) ; |
public class Util { /** * # ifdef JAVA6 */
public static final SQLException sqlException ( String msg , String sqlstate , int code , Throwable cause ) { } } | if ( sqlstate . startsWith ( "08" ) ) { if ( ! sqlstate . endsWith ( "003" ) ) { // then , e . g . - the database may spuriously cease to be " in use "
// upon retry
// - the network configuration , server availability
// may change spuriously
// - keystore location / content may change spuriously
return new SQLTransie... |
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link SystemException } with the given { @ link Throwable cause }
* and { @ link String message } formatted with the given { @ link Object [ ] arguments } .
* @ param cause { @ link Throwable } identified as the reason this { @ link ... | return new SystemException ( format ( message , args ) , cause ) ; |
public class BatchKernelImpl { /** * If jobs are still running ( i . e executingWorkUnitSets is not empty ) ,
* then wait a second or two to allow them to finish before shutting down the
* component . If after the wait the jobs are still running , then issue a message
* indicating as such and allow the component ... | // Don ' t wait if nothing to wait for . . .
if ( executingSubWorkUnits . isEmpty ( ) && executingJobs . isEmpty ( ) ) { return ; } try { // Hard - coded 2 seconds , until we have a config property
Thread . sleep ( 2 * 1000 ) ; } catch ( InterruptedException ie ) { // Let it interrupt
} if ( ! executingJobs . isEmpty (... |
public class Cursor { /** * Perform all Cursor cleanup here . */
void close ( ) { } } | mIODevice = null ; GVRSceneObject owner = getOwnerObject ( ) ; if ( owner . getParent ( ) != null ) { owner . getParent ( ) . removeChildObject ( owner ) ; } |
public class MSSQLSingleDbJDBCConnection { /** * { @ inheritDoc } */
@ Override protected void prepareQueries ( ) throws SQLException { } } | super . prepareQueries ( ) ; FIND_PROPERTY_BY_ID = "select len(DATA), I.P_TYPE, V.STORAGE_DESC from JCR_SITEM I, JCR_SVALUE V where I.ID = ? and V.PROPERTY_ID = I.ID" ; FIND_WORKSPACE_DATA_SIZE = "select sum(len(DATA)) from JCR_SITEM I, JCR_SVALUE V where I.I_CLASS=2 and I.CONTAINER_NAME=?" + " and I.ID=V.PROPERTY_ID" ... |
public class ObjectArrayTypeInfo { public static < T , C > ObjectArrayTypeInfo < T , C > getInfoFor ( Type type , TypeInformation < C > componentInfo ) { } } | // generic array type e . g . for Tuples
if ( type instanceof GenericArrayType ) { GenericArrayType genericArray = ( GenericArrayType ) type ; return new ObjectArrayTypeInfo < T , C > ( type , genericArray . getGenericComponentType ( ) , componentInfo ) ; } // for tuples without generics ( e . g . generated by the Type... |
public class CmsGwtActionElement { /** * Exports a dictionary by the given name as the content attribute of a meta tag . < p >
* @ param name the dictionary name
* @ param data the data
* @ return the meta tag */
public static String exportDictionary ( String name , String data ) { } } | StringBuffer sb = new StringBuffer ( ) ; sb . append ( "<meta name=\"" ) . append ( name ) . append ( "\" content=\"" ) . append ( data ) . append ( "\" />" ) ; return sb . toString ( ) ; |
public class JSONWriter { /** * Push an array or object scope .
* @ param options settings to control prefix output and
* optional key tracking for object vs . array scopes .
* @ throws JSONException If nesting is too deep . */
private void push ( ScopeOptions options ) throws JSONException { } } | m_top += 1 ; if ( m_top >= MAX_DEPTH ) { throw new JSONException ( "Nesting too deep." ) ; } try { m_writer . write ( options . m_prefix ) ; } catch ( IOException e ) { throw new JSONException ( e ) ; } HashSetOfString keyTracker = options . createKeyTracker ( ) ; m_scopeStack [ m_top ] = keyTracker ; m_mode = ( keyTra... |
public class SparkLine { /** * Sets the colordefinition of the area below the sparkline
* @ param AREA _ FILL _ COLOR */
public void setAreaFill ( final ColorDef AREA_FILL_COLOR ) { } } | this . areaFill = AREA_FILL_COLOR ; init ( INNER_BOUNDS . width , INNER_BOUNDS . height ) ; repaint ( INNER_BOUNDS ) ; |
public class GeometryServiceImpl { /** * Return the bounding box that defines the outer most border of a geometry .
* @ param geometry
* The geometry for which to calculate the bounding box .
* @ return The outer bounds for the given geometry . */
public Bbox getBounds ( Geometry geometry ) { } } | org . geomajas . gwt . client . spatial . geometry . Geometry geom = GeometryConverter . toGwt ( geometry ) ; return GeometryConverter . toDto ( geom . getBounds ( ) ) ; |
public class RecordingService { /** * Update and overwrites metadata recording file with final values on recording
* stop ( " . recording . RECORDING _ ID " JSON file to store Recording entity ) .
* @ return updated Recording object */
protected Recording sealRecordingMetadataFile ( Recording recording , long size ... | recording . setSize ( size ) ; // Size in bytes
recording . setDuration ( duration > 0 ? duration : 0 ) ; // Duration in seconds
if ( ! io . openvidu . java . client . Recording . Status . failed . equals ( recording . getStatus ( ) ) ) { recording . setStatus ( io . openvidu . java . client . Recording . Status . stop... |
public class WebSockets { /** * Sends a complete text message , invoking the callback when complete
* @ param message The text to send
* @ param wsChannel The web socket channel */
public static void sendTextBlocking ( final ByteBuffer message , final WebSocketChannel wsChannel ) throws IOException { } } | sendBlockingInternal ( message , WebSocketFrameType . TEXT , wsChannel ) ; |
public class ModelParameterSchemaV3 { /** * ModelParameterSchema has its own serializer so that default _ value and actual _ value
* get serialized as their native types . Autobuffer assumes all classes that have their
* own serializers should be serialized as JSON objects , and wraps them in { } , so this
* can ... | ab . putJSONStr ( "name" , name ) ; ab . put1 ( ',' ) ; ab . putJSONStr ( "label" , name ) ; ab . put1 ( ',' ) ; ab . putJSONStr ( "help" , help ) ; ab . put1 ( ',' ) ; ab . putJSONStrUnquoted ( "required" , required ? "true" : "false" ) ; ab . put1 ( ',' ) ; ab . putJSONStr ( "type" , type ) ; ab . put1 ( ',' ) ; if (... |
public class SearchParamExtractorDstu2 { /** * ( non - Javadoc )
* @ see ca . uhn . fhir . jpa . dao . ISearchParamExtractor # extractSearchParamTokens ( ca . uhn . fhir . jpa . entity . ResourceTable ,
* ca . uhn . fhir . model . api . IResource ) */
@ Override public Set < BaseResourceIndexedSearchParam > extract... | HashSet < BaseResourceIndexedSearchParam > retVal = new HashSet < BaseResourceIndexedSearchParam > ( ) ; String useSystem = null ; if ( theResource instanceof ValueSet ) { ValueSet vs = ( ValueSet ) theResource ; useSystem = vs . getCodeSystem ( ) . getSystem ( ) ; } Collection < RuntimeSearchParam > searchParams = get... |
public class AbstractBean { /** * Creates a mapping from the specified property on this Bean class to one of the Bean object ' s fields .
* @ param propertyName a String value specifying the name of a property on this Bean class .
* @ param fieldName a String value specifying the name of the Bean object ' s field .... | // TODO add possible validation for the property name and field name of this Bean class .
propertyNameToFieldNameMapping . put ( propertyName , fieldName ) ; return propertyNameToFieldNameMapping . containsKey ( propertyName ) ; |
public class HttpClientManager { /** * Execute the provided request without any special context . Caller is
* responsible for consuming the response correctly !
* @ param aRequest
* The request to be executed . May not be < code > null < / code > .
* @ return The response to be evaluated . Never < code > null <... | return execute ( aRequest , ( HttpContext ) null ) ; |
public class FTPConnection { /** * Processes commands
* @ param cmd The command and its arguments */
protected void process ( String cmd ) { } } | int firstSpace = cmd . indexOf ( ' ' ) ; if ( firstSpace < 0 ) firstSpace = cmd . length ( ) ; CommandInfo info = commands . get ( cmd . substring ( 0 , firstSpace ) . toUpperCase ( ) ) ; if ( info == null ) { sendResponse ( 502 , "Unknown command" ) ; return ; } processCommand ( info , firstSpace != cmd . length ( ) ?... |
public class ClassUtils { /** * Gets the field value for the specified qualified field name . */
public static Object getFieldValue ( String qualifiedFieldName ) { } } | Class clazz ; try { clazz = classForName ( ClassUtils . qualifier ( qualifiedFieldName ) ) ; } catch ( ClassNotFoundException cnfe ) { return null ; } try { return clazz . getField ( ClassUtils . unqualify ( qualifiedFieldName ) ) . get ( null ) ; } catch ( Exception e ) { return null ; } |
public class ParserBase { /** * Convert a comma separated list String of editions into the required
* format e . g . " ; productEdition = \ " BASE , DEVELOPERS , EXPRESS , ND , zOS \ "
* @ param editions
* @ return String the product edition supported */
private static String convertCommaSeparatedListToEditionStr... | if ( csList == null ) { return null ; } // Split the comma separated list into an array
csList = csList . trim ( ) ; List < Edition > editions = new ArrayList < Edition > ( ) ; if ( csList . length ( ) > 0 ) { String [ ] sArray = csList . split ( "," ) ; for ( String s : sArray ) { if ( s . length ( ) != 0 ) { try { ed... |
public class HighTideNode { /** * Wait for service to finish .
* ( Normally , it runs forever . ) */
public void join ( ) { } } | try { if ( server != null ) server . join ( ) ; if ( triggerThread != null ) triggerThread . join ( ) ; if ( fileFixerThread != null ) fileFixerThread . join ( ) ; } catch ( InterruptedException ie ) { // do nothing
} |
public class Vue { /** * Register a { @ link IsVueComponent } globally
* @ param id Id for our component in the templates
* @ param vueFactory The factory of the Component to create
* @ param < T > { @ link IsVueComponent } we want to attach */
@ JsOverlay public static < T extends IsVueComponent > void component... | component ( id , vueFactory . getJsConstructor ( ) ) ; |
public class XMLDatabase { /** * Creates a < code > Document < / code > object for the current state of
* this xml database .
* @ return a < code > Document < / code > object . */
private Document getDocument ( ) { } } | Document document = new Document ( ) ; Comment comment = new Comment ( " generated on " + new Date ( ) + " " ) ; document . addContent ( comment ) ; Element rootElement = new Element ( ROOT_ELEMENT_NAME ) ; rootElement . setAttribute ( MASTER_LANGUAGE_ATTRIBUTE_NAME , getMasterLanguage ( ) ) ; for ( Attribute attribute... |
public class XMLResourceBundle { /** * Return a message value with the supplied string integrated into it .
* @ param aMessage A message in which to include the supplied string value
* @ param aDetail A string value to be included into the supplied message
* @ return A message with the supplied string value integ... | return StringUtils . format ( super . getString ( aMessage ) , aDetail ) ; |
public class CellMaskedMatrix { /** * { @ inheritDoc } */
public double [ ] getColumn ( int column ) { } } | column = getIndexFromMap ( colMaskMap , column ) ; double [ ] values = new double [ rows ( ) ] ; for ( int r = 0 ; r < rows ( ) ; ++ r ) values [ r ] = matrix . get ( getIndexFromMap ( rowMaskMap , r ) , column ) ; return values ; |
public class Interval { /** * Create an interval with the specified endpoints , reordering them as needed ,
* using the specified flags
* @ param a one of the endpoints
* @ param b the other endpoint
* @ param flags flags characterizing the interval
* @ param < E > type of the interval endpoints
* @ return ... | int comp = a . compareTo ( b ) ; if ( comp <= 0 ) { return new Interval ( a , b , flags ) ; } else { return new Interval ( b , a , flags ) ; } |
public class CommandDetailParser { /** * Parse the output of the Redis COMMAND / COMMAND INFO command and convert to a list of { @ link CommandDetail } .
* @ param commandOutput the command output , must not be { @ literal null }
* @ return RedisInstance */
public static List < CommandDetail > parse ( List < ? > co... | LettuceAssert . notNull ( commandOutput , "CommandOutput must not be null" ) ; List < CommandDetail > result = new ArrayList < > ( ) ; for ( Object o : commandOutput ) { if ( ! ( o instanceof Collection < ? > ) ) { continue ; } Collection < ? > collection = ( Collection < ? > ) o ; if ( collection . size ( ) != COMMAND... |
public class PeriodValueImpl { /** * returns a period with the given start date and duration .
* @ param start non null .
* @ param dur a positive duration represented as a DateValue . */
public static PeriodValue createFromDuration ( DateValue start , DateValue dur ) { } } | DateValue end = TimeUtils . add ( start , dur ) ; if ( end instanceof TimeValue && ! ( start instanceof TimeValue ) ) { start = TimeUtils . dayStart ( start ) ; } return new PeriodValueImpl ( start , end ) ; |
public class HttpEncodingSupport { /** * Encodes a String in format suitable for use in URL ' s
* @ param input
* @ return */
public static String urlEncode ( String input ) { } } | if ( input == null ) { return "" ; } try { return URLEncoder . encode ( input , "UTF-8" ) ; } catch ( UnsupportedEncodingException uee ) { String result = StringSupport . replaceAll ( input , "&" , "%26" ) ; result = StringSupport . replaceAll ( result , "<" , "%3c" ) ; result = StringSupport . replaceAll ( result , ">... |
public class Stream { /** * Concatenates two streams .
* < p > Example :
* < pre >
* stream 1 : [ 1 , 2 , 3 , 4]
* stream 2 : [ 5 , 6]
* result : [ 1 , 2 , 3 , 4 , 5 , 6]
* < / pre >
* @ param < T > The type of stream elements
* @ param stream1 the first stream
* @ param stream2 the second stream
* ... | Objects . requireNonNull ( stream1 ) ; Objects . requireNonNull ( stream2 ) ; Stream < T > result = new Stream < T > ( new ObjConcat < T > ( stream1 . iterator , stream2 . iterator ) ) ; return result . onClose ( Compose . closeables ( stream1 , stream2 ) ) ; |
public class WebFacesConfigDescriptorImpl { /** * Returns all < code > application < / code > elements
* @ return list of < code > application < / code > */
public List < FacesConfigApplicationType < WebFacesConfigDescriptor > > getAllApplication ( ) { } } | List < FacesConfigApplicationType < WebFacesConfigDescriptor > > list = new ArrayList < FacesConfigApplicationType < WebFacesConfigDescriptor > > ( ) ; List < Node > nodeList = model . get ( "application" ) ; for ( Node node : nodeList ) { FacesConfigApplicationType < WebFacesConfigDescriptor > type = new FacesConfigAp... |
public class Cards { /** * 创建团购券
* @ param groupon
* @ return */
public String groupon ( Groupon groupon ) { } } | Card card = new Card ( ) ; card . setCardType ( "GROUPON" ) ; card . setGroupon ( groupon ) ; return createCard ( card ) ; |
public class Messages { /** * Create button message key .
* @ param gallery name
* @ return Button message key as String */
public static String getButtonName ( String gallery ) { } } | StringBuffer sb = new StringBuffer ( GUI_BUTTON_PREF ) ; sb . append ( gallery . toUpperCase ( ) ) ; sb . append ( GUI_BUTTON_SUF ) ; return sb . toString ( ) ; |
public class Patterns { /** * Returns a { @ link Pattern } object that matches if the input has at least { @ code n } characters left . Match length is
* { @ code n } if succeed . */
public static Pattern hasAtLeast ( final int n ) { } } | return new Pattern ( ) { @ Override public int match ( CharSequence src , int begin , int end ) { if ( ( begin + n ) > end ) return MISMATCH ; else return n ; } @ Override public String toString ( ) { return ".{" + n + ",}" ; } } ; |
public class CmsDefaultResourceCollector { /** * Returns a List of all resources in the folder pointed to by the parameter
* sorted by the release date , descending . < p >
* @ param cms the current CmsObject
* @ param param the folder name to use
* @ param tree if true , look in folder and all child folders , ... | CmsCollectorData data = new CmsCollectorData ( param ) ; String foldername = CmsResource . getFolderPath ( data . getFileName ( ) ) ; CmsResourceFilter filter = CmsResourceFilter . DEFAULT_FILES . addRequireType ( data . getType ( ) ) . addExcludeFlags ( CmsResource . FLAG_TEMPFILE ) ; if ( data . isExcludeTimerange ( ... |
public class ByteBuffer { /** * Append byte to this buffer . */
public void appendByte ( int b ) { } } | elems = ArrayUtils . ensureCapacity ( elems , length ) ; elems [ length ++ ] = ( byte ) b ; |
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write a delete operation . < / p >
* @ param targetId ID of the node to be deleted
* @ throws IOException if an input / output error occurs
* @ since 2.0 */
public void delete ( String targetId ) throws IOException { } } | startChangesIfNecessary ( ) ; ResponseWriter writer = getWrapped ( ) ; writer . startElement ( "delete" , null ) ; writer . writeAttribute ( "id" , targetId , null ) ; writer . endElement ( "delete" ) ; |
public class YamlBuilder { /** * A method call on the YAML builder instance will create a root object with only one key
* whose name is the name of the method being called .
* This method takes as arguments :
* < ul >
* < li > a closure < / li >
* < li > a map ( ie . named arguments ) < / li >
* < li > a ma... | return jsonBuilder . invokeMethod ( name , args ) ; |
public class GetGlue { /** * Build an OAuth authorization request .
* @ param clientId The OAuth client id obtained from tvtag .
* @ param redirectUri The URI to redirect to with appended auth code query parameter .
* @ throws OAuthSystemException */
public static OAuthClientRequest getAuthorizationRequest ( Stri... | return OAuthClientRequest . authorizationLocation ( OAUTH2_AUTHORIZATION_URL ) . setScope ( "public read write" ) . setResponseType ( ResponseType . CODE . toString ( ) ) . setClientId ( clientId ) . setRedirectURI ( redirectUri ) . buildQueryMessage ( ) ; |
public class CacheProxy { /** * Enables or disables the configuration management JMX bean . */
void enableManagement ( boolean enabled ) { } } | requireNotClosed ( ) ; synchronized ( configuration ) { if ( enabled ) { JmxRegistration . registerMXBean ( this , cacheMXBean , MBeanType . Configuration ) ; } else { JmxRegistration . unregisterMXBean ( this , MBeanType . Configuration ) ; } configuration . setManagementEnabled ( enabled ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "times" ) public JAXBElement < ArithType > createTimes ( ArithType value ) { } } | return new JAXBElement < ArithType > ( _Times_QNAME , ArithType . class , null , value ) ; |
public class HtmlOutcomeTargetLink { /** * < p > Set the value of the < code > target < / code > property . < / p > */
public void setTarget ( java . lang . String target ) { } } | getStateHelper ( ) . put ( PropertyKeys . target , target ) ; |
public class AmbiguateProperties { /** * Adds subtypes - and implementors , in the case of interfaces - of the type to its JSTypeBitSet
* of related types .
* < p > The ' is related to ' relationship is best understood graphically . Draw an arrow from each
* instance type to the prototype of each of its subclass ... | // This method could be expanded to handle union types if necessary , but currently no union
// types are ever passed as input so the method doesn ' t have logic for union types
checkState ( ! type . isUnionType ( ) , type ) ; if ( relatedBitsets . containsKey ( type ) ) { // We only need to generate the bit set once .... |
public class CalendarRecordItem { /** * Constructor .
* @ param gridScreen The screen .
* @ param iIconField The location of the icon field .
* @ param iStartDateTimeField The location of the start time .
* @ param iEndDateTimeField The location of the end time .
* @ param iDescriptionField The location of th... | m_gridScreen = gridScreen ; m_iDescriptionField = iDescriptionField ; m_iStartDateTimeField = iStartDateTimeField ; m_iEndDateTimeField = iEndDateTimeField ; m_iStatusField = iStatusField ; m_iIconField = iIconField ; |
public class Classes { /** * Get the underlying class for a type , or null if the type is a variable type .
* @ param type the type
* @ return the underlying class */
public static Class < ? > forType ( Type type ) { } } | if ( type instanceof Class ) { return ( Class < ? > ) type ; } if ( type instanceof ParameterizedType ) { return forType ( ( ( ParameterizedType ) type ) . getRawType ( ) ) ; } if ( ! ( type instanceof GenericArrayType ) ) { return null ; } Type componentType = ( ( GenericArrayType ) type ) . getGenericComponentType ( ... |
public class CmsPropertyEditorHelper { /** * Returns whether the current user has write permissions , the resource is lockable or already locked by the current user and is in the current project . < p >
* @ param cms the cms context
* @ param resource the resource
* @ return < code > true < / code > if the resour... | boolean writable = cms . hasPermissions ( resource , CmsPermissionSet . ACCESS_WRITE , false , CmsResourceFilter . IGNORE_EXPIRATION ) ; if ( writable ) { CmsLock lock = cms . getLock ( resource ) ; writable = lock . isUnlocked ( ) || lock . isOwnedBy ( cms . getRequestContext ( ) . getCurrentUser ( ) ) ; if ( writable... |
public class Matrix3d { /** * Set this matrix to a rotation transformation to make < code > - z < / code >
* point along < code > dir < / code > .
* In order to apply the lookalong transformation to any previous existing transformation ,
* use { @ link # lookAlong ( double , double , double , double , double , do... | // Normalize direction
double invDirLength = 1.0 / Math . sqrt ( dirX * dirX + dirY * dirY + dirZ * dirZ ) ; dirX *= - invDirLength ; dirY *= - invDirLength ; dirZ *= - invDirLength ; // left = up x direction
double leftX , leftY , leftZ ; leftX = upY * dirZ - upZ * dirY ; leftY = upZ * dirX - upX * dirZ ; leftZ = upX ... |
public class ForkJoinTask { /** * Reconstitutes this task from a stream ( that is , deserializes it ) . */
private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { } } | s . defaultReadObject ( ) ; Object ex = s . readObject ( ) ; if ( ex != null ) setExceptionalCompletion ( ( Throwable ) ex ) ; |
public class CcgParse { /** * Gets the logical forms for every subspan of this parse tree .
* Many of the returned logical forms combine with each other
* during the parse of the sentence .
* @ return */
public List < SpannedExpression > getSpannedLogicalForms ( ) { } } | List < SpannedExpression > spannedExpressions = Lists . newArrayList ( ) ; getSpannedLogicalFormsHelper ( spannedExpressions ) ; return spannedExpressions ; |
public class SpelExpression { /** * { @ inheritDoc } */
public T evaluate ( Object target , Map < String , Object > variables ) { } } | Expression expression = getParsedExpression ( ) ; context . setRootObject ( target ) ; if ( variables != null ) { context . setVariables ( variables ) ; } try { return ( T ) expression . getValue ( context ) ; } catch ( EvaluationException e ) { throw new RuntimeException ( e ) ; } |
public class DirectionUtil { /** * Returns which of the sixteen compass directions that point < code > b < / code > lies in from
* point < code > a < / code > as one of the { @ link DirectionCodes } direction constants .
* < em > Note : < / em > that the coordinates supplied are assumed to be logical ( screen ) rat... | return getFineDirection ( Math . atan2 ( by - ay , bx - ax ) ) ; |
public class NonRecycleableTaglibs { /** * implements the visitor to record storing of fields , and where they occur
* @ param seen
* the currently parsed opcode */
@ Override public void sawOpcode ( int seen ) { } } | if ( seen == Const . PUTFIELD ) { QMethod methodInfo = new QMethod ( getMethodName ( ) , getMethodSig ( ) ) ; Map < Map . Entry < String , String > , SourceLineAnnotation > fields = methodWrites . get ( methodInfo ) ; if ( fields == null ) { fields = new HashMap < > ( ) ; methodWrites . put ( methodInfo , fields ) ; } ... |
public class ApiOvhEmaildomain { /** * Create new filter for account
* REST : POST / email / domain / delegatedAccount / { email } / filter
* @ param value [ required ] Rule parameter of filter
* @ param action [ required ] Action of filter
* @ param actionParam [ required ] Action parameter of filter
* @ par... | String qPath = "/email/domain/delegatedAccount/{email}/filter" ; StringBuilder sb = path ( qPath , email ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; addBody ( o , "actionParam" , actionParam ) ; addBody ( o , "active" , active ) ; addBody ( o , "header" ... |
public class ManagementModule { /** * { @ inheritDoc } */
@ Override public Datastream getDatastream ( Context context , String pid , String datastreamID , Date asOfDateTime ) throws ServerException { } } | return mgmt . getDatastream ( context , pid , datastreamID , asOfDateTime ) ; |
public class MongoDBCollection { /** * Bulk remove */
public QueryResult < BulkWriteResult > remove ( List < ? extends Bson > query , QueryOptions options ) { } } | long start = startQuery ( ) ; boolean multi = false ; if ( options != null ) { multi = options . getBoolean ( MULTI ) ; } com . mongodb . bulk . BulkWriteResult wr = mongoDBNativeQuery . remove ( query , multi ) ; QueryResult < BulkWriteResult > queryResult = endQuery ( Arrays . asList ( wr ) , start ) ; return queryRe... |
public class CmsVfsDriver { /** * Updates the offline version numbers . < p >
* @ param dbc the current database context
* @ param resource the resource to update the version number for
* @ throws CmsDataAccessException if something goes wrong */
protected void internalUpdateVersions ( CmsDbContext dbc , CmsResou... | if ( dbc . getRequestContext ( ) == null ) { // no needed during initialization
return ; } if ( dbc . currentProject ( ) . isOnlineProject ( ) ) { // this method is supposed to be used only in the offline project
return ; } // read the online version numbers
Map < String , Integer > onlineVersions = readVersions ( dbc ... |
public class Stream { /** * Collects elements to { @ code supplier } provided container by applying the given accumulation function .
* < p > This is a terminal operation .
* @ param < R > the type of the result
* @ param supplier the supplier function that provides container
* @ param accumulator the accumulat... | final R result = supplier . get ( ) ; while ( iterator . hasNext ( ) ) { final T value = iterator . next ( ) ; accumulator . accept ( result , value ) ; } return result ; |
public class Excel07SaxReader { /** * s标签结束的回调处理方法 */
@ Override public void characters ( char [ ] ch , int start , int length ) throws SAXException { } } | // 得到单元格内容的值
lastContent = lastContent . concat ( new String ( ch , start , length ) ) ; |
public class ProjectTask { /** * GetDetailChildren Method . */
public ProjectTask getDetailChildren ( ) { } } | if ( m_recDetailChildren == null ) { RecordOwner recordOwner = this . getRecordOwner ( ) ; m_recDetailChildren = new ProjectTask ( recordOwner ) ; if ( recordOwner != null ) recordOwner . removeRecord ( m_recDetailChildren ) ; m_recDetailChildren . addListener ( new SubFileFilter ( this , true ) ) ; } return m_recDetai... |
public class BoxWebHookSignatureVerifier { /** * Calculates signature for a provided information .
* @ param algorithm
* for which algorithm
* @ param key
* used by signing
* @ param webHookPayload
* for singing
* @ param deliveryTimestamp
* for signing
* @ return calculated signature */
public String... | return Base64 . encode ( this . signRaw ( algorithm , key , webHookPayload , deliveryTimestamp ) ) ; |
public class EnableStreamingTaskParameters { /** * Parses properties from task parameter string
* @ param taskParameters - JSON formatted set of parameters */
public static EnableStreamingTaskParameters deserialize ( String taskParameters ) { } } | JaxbJsonSerializer < EnableStreamingTaskParameters > serializer = new JaxbJsonSerializer < > ( EnableStreamingTaskParameters . class ) ; try { EnableStreamingTaskParameters params = serializer . deserialize ( taskParameters ) ; // Verify expected parameters
if ( null == params . getSpaceId ( ) || params . getSpaceId ( ... |
public class Buckets { /** * For each value , search the appropriate bucket and add the value in it . */
public void addValues ( Collection < Long > values ) { } } | synchronized ( buckets ) { for ( Long value : values ) { addValue ( value ) ; } } |
public class MetaDataWriteOperation { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . storage . data . impl . journal . AbstractJournalOperation # writeTo ( net . timewalker . ffmq4 . storage . data . impl . journal . JournalFile ) */
@ Override protected void writeTo ( JournalFile journalFile ) throws... | super . writeTo ( journalFile ) ; journalFile . writeInt ( metaData ) ; |
public class AbstractCommand { /** * Returns an iterator over < em > all < / em > buttons by traversing
* < em > each < / em > { @ link CommandFaceButtonManager } . */
protected final Iterator buttonIterator ( ) { } } | if ( this . faceButtonManagers == null ) return Collections . EMPTY_SET . iterator ( ) ; return new NestedButtonIterator ( this . faceButtonManagers . values ( ) . iterator ( ) ) ; |
public class LObjFltFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T , R > LObjFltFunctionBuilder < T , R > objFltFunction ( Consumer < LObjFltFuncti... | return new LObjFltFunctionBuilder ( consumer ) ; |
public class ComponentFactoryDecorator { /** * { @ inheritDoc } */
@ Override public JLabel createLabel ( String labelKey , ValueModel [ ] argumentValueHolders ) { } } | return this . getDecoratedComponentFactory ( ) . createLabel ( labelKey , argumentValueHolders ) ; |
public class PullerInternal { /** * Fetches the contents of a revision from the remote db , including its parent revision ID .
* The contents are stored into rev . properties . */
@ InterfaceAudience . Private public void pullRemoteRevision ( final RevisionInternal rev ) { } } | Log . d ( TAG , "%s: pullRemoteRevision with rev: %s" , this , rev ) ; ++ httpConnectionCount ; // Construct a query . We want the revision history , and the bodies of attachments that have
// been added since the latest revisions we have locally .
// See : http : / / wiki . apache . org / couchdb / HTTP _ Document _ A... |
public class UrlEncoded { /** * Encode MultiMap with % encoding .
* @ param map the map to encode
* @ param charset the charset to use for encoding ( uses default encoding if null )
* @ param equalsForNullValue if True , then an ' = ' is always used , even
* for parameters without a value . e . g . < code > " b... | if ( charset == null ) charset = ENCODING ; StringBuilder result = new StringBuilder ( 128 ) ; boolean delim = false ; for ( Map . Entry < String , List < String > > entry : map . entrySet ( ) ) { String key = entry . getKey ( ) ; List < String > list = entry . getValue ( ) ; int s = list . size ( ) ; if ( delim ) { re... |
public class AwsSecurityFindingFilters { /** * An ISO8601 - formatted timestamp that indicates when the potential security issue captured by a finding was most
* recently observed by the security findings provider .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ ... | if ( this . lastObservedAt == null ) { setLastObservedAt ( new java . util . ArrayList < DateFilter > ( lastObservedAt . length ) ) ; } for ( DateFilter ele : lastObservedAt ) { this . lastObservedAt . add ( ele ) ; } return this ; |
public class FileTag { /** * read source file
* @ throws PageException */
private void actionRead ( boolean isBinary ) throws PageException { } } | if ( variable == null ) throw new ApplicationException ( "attribute variable is not defined for tag file" ) ; // check if we can use cache
if ( StringUtil . isEmpty ( cachedWithin ) ) { Object tmp = ( ( PageContextImpl ) pageContext ) . getCachedWithin ( ConfigWeb . CACHEDWITHIN_FILE ) ; if ( tmp != null ) setCachedwit... |
public class SegmentedJournal { /** * Resets the current segment , creating a new segment if necessary . */
private synchronized void resetCurrentSegment ( ) { } } | JournalSegment < E > lastSegment = getLastSegment ( ) ; if ( lastSegment != null ) { currentSegment = lastSegment ; } else { JournalSegmentDescriptor descriptor = JournalSegmentDescriptor . builder ( ) . withId ( 1 ) . withIndex ( 1 ) . withMaxSegmentSize ( maxSegmentSize ) . withMaxEntries ( maxEntriesPerSegment ) . b... |
public class CmsDialog { /** * Builds the necessary button row . < p >
* @ return the button row */
public String dialogLockButtons ( ) { } } | StringBuffer html = new StringBuffer ( 512 ) ; html . append ( "<div id='butClose' >\n" ) ; html . append ( dialogButtonsClose ( ) ) ; html . append ( "</div>\n" ) ; html . append ( "<div id='butContinue' class='hide' >\n" ) ; html . append ( dialogButtons ( new int [ ] { BUTTON_CONTINUE , BUTTON_CANCEL } , new String ... |
public class ZoneOffset { /** * Obtains an instance of { @ code ZoneOffset } using the ID .
* This method parses the string ID of a { @ code ZoneOffset } to
* return an instance . The parsing accepts all the formats generated by
* { @ link # getId ( ) } , plus some additional formats :
* < ul >
* < li > { @ c... | Objects . requireNonNull ( offsetId , "offsetId" ) ; // " Z " is always in the cache
ZoneOffset offset = ID_CACHE . get ( offsetId ) ; if ( offset != null ) { return offset ; } // parse - + h , + hh , + hhmm , + hh : mm , + hhmmss , + hh : mm : ss
final int hours , minutes , seconds ; switch ( offsetId . length ( ) ) {... |
public class HtmlElementUtils { /** * Parses locator string to identify the proper By subclass before calling Selenium
* { @ link WebElement # findElements ( By ) } to locate the web elements nested within the parent web .
* @ param locator
* String that represents the means to locate this element ( could be id /... | logger . entering ( new Object [ ] { locator , parent } ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( locator ) , INVALID_LOCATOR_ERR_MSG ) ; Preconditions . checkArgument ( parent != null , INVALID_PARENT_ERR_MSG ) ; List < WebElement > webElementsFound = parent . locateChildElements ( locator ) ; // ... |
public class IdResource { /** * Get a new ID and handle any thrown exceptions
* @ param agent
* User Agent
* @ return generated ID
* @ throws SnowizardException */
public long getId ( final String agent ) { } } | try { return worker . getId ( agent ) ; } catch ( final InvalidUserAgentError e ) { LOGGER . error ( "Invalid user agent ({})" , agent ) ; throw new SnowizardException ( Response . Status . BAD_REQUEST , "Invalid User-Agent header" , e ) ; } catch ( final InvalidSystemClock e ) { LOGGER . error ( "Invalid system clock"... |
public class CFFFontSubset { /** * Read the FDArray count , offsize and Offset array
* @ param Font */
protected void ReadFDArray ( int Font ) { } } | seek ( fonts [ Font ] . fdarrayOffset ) ; fonts [ Font ] . FDArrayCount = getCard16 ( ) ; fonts [ Font ] . FDArrayOffsize = getCard8 ( ) ; // Since we will change values inside the FDArray objects
// We increase its offsize to prevent errors
if ( fonts [ Font ] . FDArrayOffsize < 4 ) fonts [ Font ] . FDArrayOffsize ++ ... |
public class WorkbinsApi { /** * Unsubscribe to the notifications of changes of the content of a Workbin .
* @ param workbinId Id of the Workbin ( required )
* @ param unsubscribeToWorkbinNotificationsData ( required )
* @ return ApiResponse & lt ; ApiSuccessResponse & gt ;
* @ throws ApiException If fail to ca... | com . squareup . okhttp . Call call = unsubscribeToWorkbinNotificationsValidateBeforeCall ( workbinId , unsubscribeToWorkbinNotificationsData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class AmazonElasticLoadBalancingClient { /** * Creates a rule for the specified listener . The listener must be associated with an Application Load Balancer .
* Rules are evaluated in priority order , from the lowest value to the highest value . When the conditions for a rule
* are met , its actions are perf... | request = beforeClientExecution ( request ) ; return executeCreateRule ( request ) ; |
public class MaterialCheckBox { /** * Setting the type of Checkbox . */
public void setType ( CheckBoxType type ) { } } | this . type = type ; switch ( type ) { case FILLED : Element input = DOM . getChild ( getElement ( ) , 0 ) ; input . setAttribute ( "class" , CssName . FILLED_IN ) ; break ; case INTERMEDIATE : addStyleName ( type . getCssName ( ) + "-checkbox" ) ; break ; default : addStyleName ( type . getCssName ( ) ) ; break ; } |
public class GeoInterface { /** * Return a list of photos for a user at a specific latitude , longitude and accuracy .
* @ param location
* @ param extras
* @ param perPage
* @ param page
* @ return The collection of Photo objects
* @ throws FlickrException
* @ see com . flickr4java . flickr . photos . Ex... | Map < String , Object > parameters = new HashMap < String , Object > ( ) ; PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; parameters . put ( "method" , METHOD_PHOTOS_FOR_LOCATION ) ; if ( extras . size ( ) > 0 ) { parameters . put ( "extras" , StringUtilities . join ( extras , "," ) ) ; } if ( perPage > 0 )... |
public class StringUtils { /** * Convert all the first letter of the words of target to uppercase
* ( title - case , in fact ) , using the specified delimiter chars for determining
* word ends / starts .
* @ param target the String to be capitalized . If non - String object , toString ( )
* will be called .
*... | if ( target == null ) { return null ; } final char [ ] buffer = target . toString ( ) . toCharArray ( ) ; final char [ ] delimiterChars = ( delimiters == null ? null : delimiters . toString ( ) . toCharArray ( ) ) ; if ( delimiterChars != null ) { // needed in order to use binarySearch
Arrays . sort ( delimiterChars ) ... |
public class Index { /** * Adds a new { @ link Analyzer } .
* @ param name the name of the { @ link Analyzer } to be added
* @ param analyzer the { @ link Analyzer } to be added
* @ return this with the specified analyzer */
public Index analyzer ( String name , Analyzer analyzer ) { } } | schema . analyzer ( name , analyzer ) ; return this ; |
public class ScheduledExecutorContainer { /** * State is published after every run .
* When replicas get promoted , they start with the latest state . */
void publishTaskState ( String taskName , Map stateSnapshot , ScheduledTaskStatisticsImpl statsSnapshot , ScheduledTaskResult result ) { } } | if ( logger . isFinestEnabled ( ) ) { log ( FINEST , "Publishing state, to replicas. State: " + stateSnapshot ) ; } Operation op = new SyncStateOperation ( getName ( ) , taskName , stateSnapshot , statsSnapshot , result ) ; createInvocationBuilder ( op ) . invoke ( ) . join ( ) ; |
public class MessageRetriever { /** * Print a message .
* @ param pos the position of the source
* @ param key selects message from resource
* @ param args arguments to be replaced in the message . */
public void notice ( SourcePosition pos , String key , Object ... args ) { } } | printNotice ( pos , getText ( key , args ) ) ; |
public class MockAgentPlan { /** * Method to send Request messages to a specific df _ service
* @ param df _ service
* The name of the df _ service
* @ param msgContent
* The content of the message to be sent
* @ return Message sent to + the name of the df _ service */
protected String sendRequestToDF ( Strin... | IDFComponentDescription [ ] receivers = getReceivers ( df_service ) ; if ( receivers . length > 0 ) { IMessageEvent mevent = createMessageEvent ( "send_request" ) ; mevent . getParameter ( SFipa . CONTENT ) . setValue ( msgContent ) ; for ( int i = 0 ; i < receivers . length ; i ++ ) { mevent . getParameterSet ( SFipa ... |
public class FacebookRestClient { /** * Sets the FBML for a profile box on the logged - in user ' s profile .
* @ param fbmlMarkup refer to the FBML documentation for a description of the markup and its role in various contexts
* @ return a boolean indicating whether the FBML was successfully set
* @ see < a href... | return profile_setFBML ( fbmlMarkup , /* profileActionFbmlMarkup */
null , /* mobileFbmlMarkup */
null , /* profileId */
null ) ; |
public class AstyanaxEventId { /** * Computes a 16 - bit checksum of the contents of the specific ByteBuffer and channel name . */
private static int computeChecksum ( byte [ ] buf , int offset , int length , String channel ) { } } | Hasher hasher = Hashing . murmur3_32 ( ) . newHasher ( ) ; hasher . putBytes ( buf , offset , length ) ; hasher . putUnencodedChars ( channel ) ; return hasher . hash ( ) . asInt ( ) & 0xffff ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.