signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CommerceOrderUtil { /** * Returns the commerce order where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache .
* @ param uuid the uuid
* @ param groupId the group ID
* @ param retrieveFromCache whether to retrieve f... | return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ; |
public class Learner { /** * Create a Document from an array of Strings */
public Document createDocument ( String [ ] tokenstring ) { } } | this . lexicon . incrementDocCount ( ) ; return new SimpleDocument ( tokenstring , this . lexicon , true ) ; |
public class TypeResolver { /** * Resolves a given parameterized type . If the parameterized type contains no type variables it is returned untouched .
* Otherwise , a new { @ link ParameterizedType } instance is returned in which each type variable is resolved using
* { @ link # resolveType ( TypeVariable ) } . */... | Type [ ] unresolvedTypeArguments = type . getActualTypeArguments ( ) ; /* * Indicates whether we managed to resolve any of type arguments . If we did not then there is no need to create a new
* ParameterizedType with the old parameters . Instead , we return the original type . */
boolean modified = false ; Type [ ] r... |
public class ClusterClient { /** * Creates the optimized plan for a given program , using this client ' s compiler .
* @ param prog The program to be compiled .
* @ return The compiled and optimized plan , as returned by the compiler .
* @ throws CompilerException Thrown , if the compiler encounters an illegal si... | return getOptimizedPlan ( compiler , prog . getPlan ( ) , parallelism ) ; |
public class DateUtils { /** * Get specify weeks back from given date .
* @ param weeksBack how many weeks want to be back .
* @ param date date to be handled .
* @ return a new Date object . */
public static Date getDateOfWeeksBack ( final int weeksBack , final Date date ) { } } | return dateBack ( Calendar . WEEK_OF_MONTH , weeksBack , date ) ; |
public class LinearSolverFactory_DDRM { /** * Creates a solver for symmetric positive definite matrices .
* @ return A new solver for symmetric positive definite matrices . */
public static LinearSolverDense < DMatrixRMaj > symmPosDef ( int matrixWidth ) { } } | if ( matrixWidth < EjmlParameters . SWITCH_BLOCK64_CHOLESKY ) { CholeskyDecompositionCommon_DDRM decomp = new CholeskyDecompositionInner_DDRM ( true ) ; return new LinearSolverChol_DDRM ( decomp ) ; } else { if ( EjmlParameters . MEMORY == EjmlParameters . MemoryUsage . FASTER ) return new LinearSolverChol_DDRB ( ) ; e... |
public class Strings { /** * Join collection of objects , converted to string , using specified char separator . Returns null if given objects
* array is null and empty if empty .
* @ param objects collection of objects to join ,
* @ param separator character used as separator .
* @ return joined string . */
pu... | return join ( objects , Character . toString ( separator ) ) ; |
public class SHA1 { /** * Restore the digest to its previously - saved state . */
public void restoreState ( ) { } } | h0 = s0 ; h1 = s1 ; h2 = s2 ; h3 = s3 ; h4 = s4 ; length = saveLength ; finalBuffer . clear ( ) ; finalBuffer . put ( saveBuffer ) ; |
public class FileBasedCollection { /** * Save file to website ' s resource directory .
* @ param handle Weblog handle to save to
* @ param name Name of file to save
* @ param size Size of file to be saved
* @ param is Read file from input stream */
private void saveMediaFile ( final String name , final String c... | final byte [ ] buffer = new byte [ 8192 ] ; int bytesRead = 0 ; final File dirPath = new File ( getEntryMediaPath ( name ) ) ; if ( ! dirPath . getParentFile ( ) . exists ( ) ) { dirPath . getParentFile ( ) . mkdirs ( ) ; } OutputStream bos = null ; try { bos = new FileOutputStream ( dirPath . getAbsolutePath ( ) ) ; w... |
public class CPRuleUserSegmentRelLocalServiceBaseImpl { /** * Creates a new cp rule user segment rel with the primary key . Does not add the cp rule user segment rel to the database .
* @ param CPRuleUserSegmentRelId the primary key for the new cp rule user segment rel
* @ return the new cp rule user segment rel */... | return cpRuleUserSegmentRelPersistence . create ( CPRuleUserSegmentRelId ) ; |
public class VerificationCodeImage { /** * 随机生成一种字体
* @ return 返回随机生成的字体 */
private Font randomFont ( ) { } } | Random r = new Random ( ) ; int index = r . nextInt ( this . fontNames . length ) ; String fontName = this . fontNames [ index ] ; int style = r . nextInt ( 4 ) ; int size = ( this . fontSizeRange > 0 ? r . nextInt ( this . fontSizeRange ) : 0 ) + this . fontBasicSize ; return new Font ( fontName , style , size ) ; |
public class Strings { /** * Extracts specially marked arguments from a string , and returns the string with such arguments replaced with " { } " .
* < ol >
* < li > Arguments are enclosed between ' { ' and ' } ' < / li >
* < li > Optional extra text is allowed at the end of line starting with ' # ' , which is re... | Matcher matcher = PARAM_SYNTAX . matcher ( substringBefore ( original , '#' ) ) ; while ( matcher . find ( ) ) { try { params . add ( matcher . group ( 1 ) ) ; } catch ( Exception x ) { throw new IllegalArgumentException ( "Translation format specification" , x ) ; } } return matcher . replaceAll ( "{}" ) ; |
public class Config { /** * Returns the config value for the specified key or { @ code null } if the key
* was not found . If the key is defined in both , the remote and the fallback config ,
* the value from the remote config will be returned . If the value is < i > only < / i > defined
* in the fallback config ... | if ( onlineProps . containsKey ( key ) ) return onlineProps . getProperty ( key ) ; else return offlineProps . getProperty ( key ) ; |
public class NameSpace { /** * Helper for implementing NameSource .
* @ param vec the vec */
protected void getAllNamesAux ( final List < String > vec ) { } } | vec . addAll ( this . variables . keySet ( ) ) ; if ( methods != null ) vec . addAll ( this . methods . keySet ( ) ) ; if ( this . parent != null ) this . parent . getAllNamesAux ( vec ) ; |
public class TreeLoader { /** * Find all the jars in this directory and add them to jarList . */
protected void loadPaths ( ArrayList < PathImpl > paths , PathImpl dir ) { } } | try { for ( String fileName : dir . list ( ) ) { PathImpl path = dir . lookup ( fileName ) ; if ( fileName . endsWith ( ".jar" ) || fileName . endsWith ( ".zip" ) ) { paths . add ( path ) ; } else if ( path . isDirectory ( ) ) { loadPaths ( paths , path ) ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } |
public class RuleBasedPluralizer { /** * Apply processing to < code > pluralizedWord < / code > . This implementation ensures the case of the
* plural is consistent with the case of the input word .
* If < code > trimmedWord < / code > is all uppercase , then < code > pluralizedWord < / code > is uppercased .
* I... | if ( pluPattern1 . matcher ( trimmedWord ) . matches ( ) ) { return pluralizedWord . toUpperCase ( locale ) ; } else if ( pluPattern2 . matcher ( trimmedWord ) . matches ( ) ) { return pluralizedWord . substring ( 0 , 1 ) . toUpperCase ( locale ) + pluralizedWord . substring ( 1 ) ; } return pluralizedWord ; |
public class JackrabbitContentRepository { /** * Resolves a name to an { @ link Authorizable } . The name can be of a user or a group . The resulting authroziable can
* be of type { @ link org . apache . jackrabbit . api . security . user . User } or { @ link org . apache . jackrabbit . api . security . user . Group ... | final Session session = getAdminSession ( ) ; final UserManager userManager = ( ( JackrabbitSession ) session ) . getUserManager ( ) ; final Authorizable authorizable = userManager . getAuthorizable ( authorizableId ) ; assertNotNull ( "Could not resolve " + authorizableId , authorizable ) ; return authorizable ; |
public class WebSocketConnectionRegistry { /** * Accept a visitor to iterate through the connections attached to the key specified
* @ param key
* the key
* @ param visitor
* the visitor */
public void accept ( String key , $ . Function < WebSocketConnection , ? > visitor ) { } } | ConcurrentMap < WebSocketConnection , WebSocketConnection > connections = registry . get ( key ) ; if ( null == connections ) { return ; } if ( ! connections . isEmpty ( ) ) { lock . lock ( ) ; try { List < WebSocketConnection > toBeCleared = null ; for ( WebSocketConnection conn : connections . keySet ( ) ) { if ( con... |
public class WsonrpcControl { /** * 处理收到的JSON数据
* @ param session
* @ param bytes */
public void handle ( final WebSocketSession session , byte [ ] bytes ) { } } | if ( session == null ) { throw new NullPointerException ( "session" ) ; } try { JsonRpcMessage msg = jsonRpcControl . receive ( bytes ) ; if ( msg instanceof JsonRpcRequest ) { handleRequest ( session , ( JsonRpcRequest ) msg ) ; } else if ( msg instanceof JsonRpcResponse ) { handleResponse ( session , ( JsonRpcRespons... |
public class DescribeClientVpnAuthorizationRulesResult { /** * Information about the authorization rules .
* @ return Information about the authorization rules . */
public java . util . List < AuthorizationRule > getAuthorizationRules ( ) { } } | if ( authorizationRules == null ) { authorizationRules = new com . amazonaws . internal . SdkInternalList < AuthorizationRule > ( ) ; } return authorizationRules ; |
public class AbstractHttpHandler { /** * Instrument an HTTP span after a message is received . Typically called for every chunk of
* request or response is received .
* @ param context request specific { @ link HttpRequestContext }
* @ param bytes bytes received .
* @ since 0.19 */
public final void handleMessa... | checkNotNull ( context , "context" ) ; context . receiveMessageSize . addAndGet ( bytes ) ; if ( context . span . getOptions ( ) . contains ( Options . RECORD_EVENTS ) ) { // record compressed size
recordMessageEvent ( context . span , context . receviedSeqId . addAndGet ( 1L ) , Type . RECEIVED , bytes , 0L ) ; } |
public class SimpleAuthenticator { /** * Gets the SimpleAuthenticator instance and registers it through the
* Authenticator . setDefault ( ) . If there is no current instance
* of the SimpleAuthenticator in the VM , one is created . This method will
* try to figure out if the setDefault ( ) succeeded ( a hack ) ,... | if ( ! sInitialized ) { // Create an instance
sInstance = new SimpleAuthenticator ( ) ; // Try to set default ( this may quietly fail . . . )
Authenticator . setDefault ( sInstance ) ; // A hack to figure out if we really did set the authenticator
PasswordAuthentication pa = Authenticator . requestPasswordAuthenticatio... |
public class Tuple8 { /** * Limit this tuple to degree 8. */
public final Tuple8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > limit8 ( ) { } } | return this ; |
public class Record { /** * Get column of mysql type : decimal , numeric */
public java . math . BigDecimal getBigDecimal ( String column ) { } } | return ( java . math . BigDecimal ) getColumns ( ) . get ( column ) ; |
public class CmsEmbeddedDialogHandler { /** * Called on dialog close . < p >
* @ param resources the resource ids to update as a ' ; ' separated string . < p > */
public void finish ( String resources ) { } } | if ( m_frame != null ) { m_frame . removeFromParent ( ) ; m_frame = null ; } if ( m_handler != null ) { List < CmsUUID > resourceIds = parseResources ( resources ) ; if ( ! resourceIds . isEmpty ( ) ) { m_handler . refreshResource ( resourceIds . get ( 0 ) ) ; } } if ( m_onCloseCommand != null ) { m_onCloseCommand . ex... |
public class CollectionHelper { /** * Populate the source with the destination tags only if they
* match the pattern rules for the tags
* @ param source The source to check
* @ param destination The destination to fill
* @ return The destination updated */
private static Set < String > populateTags ( Set < Stri... | for ( String tag : source ) { if ( ! tagPattern . matcher ( tag ) . matches ( ) ) { LOGGER . warn ( "The tag {} does not respect the following pattern {} and is ignored" , tag , tagPattern . pattern ( ) ) ; } else if ( destination . contains ( tag ) ) { LOGGER . info ( "The tag {} is already present in the collection a... |
public class UIComponentTag { /** * Return the nearest JSF tag that encloses this tag .
* @ deprecated */
public static UIComponentTag getParentUIComponentTag ( PageContext pageContext ) { } } | UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase ( pageContext ) ; return parentTag instanceof UIComponentTag ? ( UIComponentTag ) parentTag : new UIComponentTagWrapper ( parentTag ) ; |
public class PipelineMavenPluginH2v1Dao { /** * List the artifacts generated by the given build
* @ param jobFullName see { @ link Item # getFullName ( ) }
* @ param buildNumber see { @ link Run # getNumber ( ) }
* @ return list of artifact details stored as maps ( " gav " , " type " , " skip _ downstream _ trigg... | LOGGER . log ( Level . FINER , "getGeneratedArtifacts({0}, {1})" , new Object [ ] { jobFullName , buildNumber } ) ; String generatedArtifactsSql = "SELECT DISTINCT MAVEN_ARTIFACT.*, GENERATED_MAVEN_ARTIFACT.* " + " FROM MAVEN_ARTIFACT " + " INNER JOIN GENERATED_MAVEN_ARTIFACT ON MAVEN_ARTIFACT.ID = GENERATED_MAVEN_ART... |
public class Hystrix { /** * Reset state and release resources in use ( such as threadpools ) and wait for completion .
* NOTE : This can result in race conditions if HystrixCommands are concurrently being executed .
* @ param time
* time to wait for thread - pools to shutdown
* @ param unit
* { @ link TimeUn... | // shutdown thread - pools
HystrixThreadPool . Factory . shutdown ( time , unit ) ; _reset ( ) ; |
public class RequestContext { /** * Gets the metadata for the current request
* @ return the request metadata */
public static RequestMetadata getRequestMetadata ( ) { } } | RequestMetadata metadata = threadLocal . get ( ) ; if ( metadata == null ) metadata = getNoMetadata ( ) ; return metadata ; |
public class MembershipTypeHandlerImpl { /** * Puts membership type in cache . */
private void putInCache ( MembershipType mt ) { } } | cache . put ( mt . getName ( ) , mt , CacheType . MEMBERSHIPTYPE ) ; |
public class DescribeTransitGatewaysResult { /** * Information about the transit gateways .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTransitGateways ( java . util . Collection ) } or { @ link # withTransitGateways ( java . util . Collection ) } if y... | if ( this . transitGateways == null ) { setTransitGateways ( new com . amazonaws . internal . SdkInternalList < TransitGateway > ( transitGateways . length ) ) ; } for ( TransitGateway ele : transitGateways ) { this . transitGateways . add ( ele ) ; } return this ; |
public class DeepWalk { /** * Fit the model , in parallel .
* This creates a set of GraphWalkIterators , which are then distributed one to each thread
* @ param graph Graph to fit
* @ param walkLength Length of rangom walks to generate */
public void fit ( IGraph < V , E > graph , int walkLength ) { } } | if ( ! initCalled ) initialize ( graph ) ; // First : create iterators , one for each thread
GraphWalkIteratorProvider < V > iteratorProvider = new RandomWalkGraphIteratorProvider < > ( graph , walkLength , seed , NoEdgeHandling . SELF_LOOP_ON_DISCONNECTED ) ; fit ( iteratorProvider ) ; |
public class KubernetesEndpointConfiguration { /** * Constructs or gets the kubernetes client implementation .
* @ return */
public io . fabric8 . kubernetes . client . KubernetesClient getKubernetesClient ( ) { } } | if ( kubernetesClient == null ) { kubernetesClient = createKubernetesClient ( ) ; } return kubernetesClient ; |
public class AbstractFacade { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public < E extends R > List < E > retrieveFilter ( final UniqueKey < E > uniqueKey ) { } } | // TODO evaluate performances ! ! ! ! !
return ( List < E > ) this . componentMap . entrySet ( ) . stream ( ) . filter ( entry -> entry . getKey ( ) . classField ( ) == uniqueKey . classField ( ) ) . flatMap ( s -> s . getValue ( ) . stream ( ) ) . collect ( Collectors . toList ( ) ) ; |
public class ExpressRouteCrossConnectionPeeringsInner { /** * Deletes the specified peering from the ExpressRouteCrossConnection .
* @ param resourceGroupName The name of the resource group .
* @ param crossConnectionName The name of the ExpressRouteCrossConnection .
* @ param peeringName The name of the peering ... | deleteWithServiceResponseAsync ( resourceGroupName , crossConnectionName , peeringName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class JenkinsServer { /** * Create a view on the server using the provided xml
* @ param viewName name of the view to be created .
* @ param viewXml The configuration for the view .
* @ throws IOException in case of an error . */
public JenkinsServer createView ( String viewName , String viewXml ) throws I... | return createView ( null , viewName , viewXml , false ) ; |
public class SimpleBitSet { /** * Reconstitute the < tt > BitSet < / tt > instance from a ByteBuffer ( i . e . ,
* deserialize it ) . */
public void deserialize ( final ByteBuffer buf ) { } } | wordsInUse = buf . getInt ( ) ; words = new long [ wordsInUse ] ; for ( int i = 0 ; i < words . length ; i ++ ) { words [ i ] = buf . getLong ( ) ; } // Assume maximum length then find real length
// because recalculateWordsInUse assumes maintenance
// or reduction in logical size
wordsInUse = words . length ; recalcul... |
public class CPDefinitionGroupedEntryPersistenceImpl { /** * Returns the last cp definition grouped entry in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < cod... | CPDefinitionGroupedEntry cpDefinitionGroupedEntry = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( cpDefinitionGroupedEntry != null ) { return cpDefinitionGroupedEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . appen... |
public class Bidi { /** * Returns the directionality of the first strong character , or digit , in the epilogue , if any .
* Requires epilogue ! = null . */
private byte firstL_R_AL_EN_AN ( ) { } } | for ( int i = 0 ; i < epilogue . length ( ) ; ) { int uchar = epilogue . codePointAt ( i ) ; i += Character . charCount ( uchar ) ; byte dirProp = ( byte ) getCustomizedClass ( uchar ) ; if ( dirProp == L ) { return _L ; } if ( dirProp == R || dirProp == AL ) { return _R ; } if ( dirProp == EN ) { return _EN ; } if ( d... |
public class QuadTreeNode { /** * Set the third child of this node .
* @ param newChild is the new child for the third zone
* @ return < code > true < / code > on success , otherwhise < code > false < / code > */
public boolean setThirdChild ( N newChild ) { } } | final N oldChild = this . nSouthWest ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 2 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ... |
public class JGroupsExtension { /** * { @ inheritDoc }
* @ see org . jboss . as . controller . Extension # initialize ( org . jboss . as . controller . ExtensionContext ) */
@ Override public void initialize ( ExtensionContext context ) { } } | SubsystemRegistration registration = context . registerSubsystem ( SUBSYSTEM_NAME , JGroupsModel . CURRENT . getVersion ( ) ) ; registration . registerSubsystemModel ( new JGroupsSubsystemResourceDefinition ( context . isRuntimeOnlyRegistrationValid ( ) ) ) ; registration . registerXMLElementWriter ( new JGroupsSubsyst... |
public class AmazonCodeDeployClient { /** * Deletes a deployment configuration .
* < note >
* A deployment configuration cannot be deleted if it is currently in use . Predefined configurations cannot be
* deleted .
* < / note >
* @ param deleteDeploymentConfigRequest
* Represents the input of a DeleteDeploy... | request = beforeClientExecution ( request ) ; return executeDeleteDeploymentConfig ( request ) ; |
public class Overlay { /** * Convenience method to draw a Drawable at an offset . x and y are pixel coordinates . You can
* find appropriate coordinates from latitude / longitude using the MapView . getProjection ( ) method
* on the MapView passed to you in draw ( Canvas , MapView , boolean ) .
* @ param shadow
... | canvas . save ( ) ; canvas . rotate ( - aMapOrientation , x , y ) ; drawable . copyBounds ( mRect ) ; drawable . setBounds ( mRect . left + x , mRect . top + y , mRect . right + x , mRect . bottom + y ) ; drawable . draw ( canvas ) ; drawable . setBounds ( mRect ) ; canvas . restore ( ) ; |
public class HttpRequest { /** * Resets the value of the given header .
* @ param header
* the name of the header to reset .
* @ return
* the object itself , for method chaining . */
public HttpRequest withoutHeader ( String header ) { } } | if ( headers . containsKey ( header ) ) { headers . remove ( header ) ; } return this ; |
public class CmsPatternPanelMonthlyView { /** * Fills the week panel with checkboxes . */
private void fillWeekPanel ( ) { } } | addCheckBox ( WeekOfMonth . FIRST . toString ( ) , Messages . GUI_SERIALDATE_WEEKDAYNUMBER_1_0 ) ; addCheckBox ( WeekOfMonth . SECOND . toString ( ) , Messages . GUI_SERIALDATE_WEEKDAYNUMBER_2_0 ) ; addCheckBox ( WeekOfMonth . THIRD . toString ( ) , Messages . GUI_SERIALDATE_WEEKDAYNUMBER_3_0 ) ; addCheckBox ( WeekOfMo... |
public class System { /** * Returns the Process which contains the exit code . */
public static Process runProcess ( String [ ] cmdArray , File logFile , File dir ) { } } | try { ProcessBuilder pb = new ProcessBuilder ( cmdArray ) ; pb . redirectErrorStream ( true ) ; pb . directory ( dir ) ; Process proc = pb . start ( ) ; if ( logFile != null ) { // Redirect stderr and stdout to logFile
// TODO : in Java 7 , use redirectOutput ( Redirect . to ( logFile ) )
InputStream inputStream = new ... |
public class RDistinct { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return all nodes , relationships and paths found in a query , < / i > < / div >
... | ReturnExpression rx = getReturnExpression ( ) ; ReturnElement elem = new ReturnElement ( ) ; elem . setAll ( ) ; rx . setReturnValue ( elem ) ; RTerminal ret = new RTerminal ( rx ) ; return ret ; |
public class AnnotationUtils { /** * Returns links from given annotations .
* @ param annotations annotations to analyse .
* @ return discovered links . */
public static List < Link > getLinks ( final Collection < Annotation > annotations ) { } } | final List < Link > result = new ArrayList < > ( ) ; result . addAll ( extractLinks ( annotations , io . qameta . allure . Link . class , ResultsUtils :: createLink ) ) ; result . addAll ( extractLinks ( annotations , io . qameta . allure . Issue . class , ResultsUtils :: createLink ) ) ; result . addAll ( extractLinks... |
public class HtmlEscape { /** * Perform an HTML5 level 1 ( XML - style ) < strong > escape < / strong > operation on a < tt > char [ ] < / tt > input .
* < em > Level 1 < / em > means this method will only escape the five markup - significant characters :
* < tt > & lt ; < / tt > , < tt > & gt ; < / tt > , < tt > &... | escapeHtml ( text , offset , len , writer , HtmlEscapeType . HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL , HtmlEscapeLevel . LEVEL_1_ONLY_MARKUP_SIGNIFICANT ) ; |
public class CsvEscape { /** * Perform a CSV < strong > unescape < / strong > operation on a < tt > Reader < / tt > input , writing results
* to a < tt > Writer < / tt > .
* This method is < strong > thread - safe < / strong > .
* @ param reader the < tt > Reader < / tt > reading the text to be unescaped .
* @ ... | if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } CsvEscapeUtil . unescape ( reader , writer ) ; |
public class RegisteredHttpServiceImpl { /** * { @ inheritDoc } */
@ Override public void registerServlet ( String alias , Servlet servlet , Dictionary initparams , HttpContext context ) throws ServletException , NamespaceException { } } | if ( servlet == null ) { throw new IllegalArgumentException ( "Servlet must not be null" ) ; } if ( ! isAliasValid ( alias ) ) { throw new IllegalArgumentException ( "Malformed servlet alias [" + alias + "]" ) ; } ServletHandler handler = new ServletHandler ( getServletContext ( context ) , servlet , alias ) ; handler ... |
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetDateTimeParameter ( DateTimeParameterType newDateTimeParameter , NotificationChain msgs ) { } } | return ( ( FeatureMap . Internal ) getMixed ( ) ) . basicAdd ( BpsimPackage . Literals . DOCUMENT_ROOT__DATE_TIME_PARAMETER , newDateTimeParameter , msgs ) ; |
public class PromptMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Prompt prompt , ProtocolMarshaller protocolMarshaller ) { } } | if ( prompt == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( prompt . getMessages ( ) , MESSAGES_BINDING ) ; protocolMarshaller . marshall ( prompt . getMaxAttempts ( ) , MAXATTEMPTS_BINDING ) ; protocolMarshaller . marshall ( prompt . get... |
public class JdbiMappers { /** * Returns a Boolean or null if the column was null . */
@ SuppressFBWarnings ( "NP_BOOLEAN_RETURN_NULL" ) public static Boolean getBoolean ( final ResultSet rs , final int columnIndex ) throws SQLException { } } | final boolean res = rs . getBoolean ( columnIndex ) ; if ( rs . wasNull ( ) ) { return null ; } else { return res ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractBoundarySurfaceType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractBoundarySurf... | return new JAXBElement < AbstractBoundarySurfaceType > ( __BoundarySurface_QNAME , AbstractBoundarySurfaceType . class , null , value ) ; |
public class IsDateWithTime { /** * Creates a matcher that matches when the examined { @ linkplain Date } has the given values < code > hour < / code > in a 24
* hours clock period , < code > minute < / code > and < code > sec < / code > . */
public static Matcher < Date > hasHourMinAndSec ( final int hour , final in... | return new IsDateWithTime ( hour , minute , second , null ) ; |
public class DocumentStyleImpl { /** * Fix style property names . */
public String fixPropertyName ( String name ) { } } | if ( "float" . equalsIgnoreCase ( name ) ) { return "cssFloat" ; } else if ( "for" . equalsIgnoreCase ( name ) ) { return "htmlFor" ; } return JsUtils . camelize ( name ) ; |
public class CFEndPointSerializer { /** * Method to serialize a given channel object into the overall output
* buffer .
* @ param buffer
* @ param ocd
* @ param order
* @ return StringBuilder ( expanded with new data )
* @ throws NotSerializableException */
static private StringBuilder serializeChannel ( St... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Serializing channel: " + order + " " + ocd . getOutboundFactory ( ) . getName ( ) ) ; } buffer . append ( " <channel order=\"" ) ; buffer . append ( order ) ; buffer . append ( "\" factory=\"" ) ; buffer . append ( ocd . g... |
public class MonthView { /** * Sets up the text and style properties for painting . Override this if you
* want to use a different paint . */
protected void initView ( ) { } } | mMonthTitlePaint = new Paint ( ) ; if ( mController . getVersion ( ) == DatePickerDialog . Version . VERSION_1 ) mMonthTitlePaint . setFakeBoldText ( true ) ; mMonthTitlePaint . setAntiAlias ( true ) ; mMonthTitlePaint . setTextSize ( MONTH_LABEL_TEXT_SIZE ) ; mMonthTitlePaint . setTypeface ( Typeface . create ( mMonth... |
public class Block { /** * The type of entity . The following can be returned :
* < ul >
* < li >
* < i > KEY < / i > - An identifier for a field on the document .
* < / li >
* < li >
* < i > VALUE < / i > - The field text .
* < / li >
* < / ul >
* < code > EntityTypes < / code > isn ' t returned by <... | java . util . ArrayList < String > entityTypesCopy = new java . util . ArrayList < String > ( entityTypes . length ) ; for ( EntityType value : entityTypes ) { entityTypesCopy . add ( value . toString ( ) ) ; } if ( getEntityTypes ( ) == null ) { setEntityTypes ( entityTypesCopy ) ; } else { getEntityTypes ( ) . addAll... |
public class CentralAuthenticationServiceEventsPublishingAspect { @ AfterReturning ( pointcut = "createTicketGrantingTicketMethodExecution()" , returning = "ticketGrantingTicketId" ) public void publishCasSsoSessionEstablishedEvent ( final JoinPoint jp , final String ticketGrantingTicketId ) { } } | doPublish ( new CasSsoSessionEstablishedEvent ( jp . getTarget ( ) , this . authenticationSupport . getAuthenticationFrom ( ticketGrantingTicketId ) , ticketGrantingTicketId ) ) ; |
public class AppiumFieldDecorator { /** * Decorated page object { @ code field } .
* @ param ignored class loader is ignored by current implementation
* @ param field is { @ link Field } of page object which is supposed to be decorated .
* @ return a field value or null . */
public Object decorate ( ClassLoader i... | Object result = defaultElementFieldDecoracor . decorate ( ignored , field ) ; if ( result != null ) { return result ; } return decorateWidget ( field ) ; |
public class HBaseReader { /** * Scan and populate { @ link HBaseData } collection using scanned results .
* @ param columnFamily
* column family .
* @ param results
* results .
* @ param scanner
* result scanner .
* @ return collection of scanned results .
* @ throws IOException */
private List < HBase... | HBaseData data = null ; if ( fetchSize == null ) { for ( Result result : scanner ) { List < KeyValue > values = result . list ( ) ; for ( KeyValue value : values ) { data = new HBaseData ( columnFamily != null ? columnFamily : new String ( value . getFamily ( ) ) , value . getRow ( ) ) ; break ; } data . setColumns ( v... |
public class DifferentialFunctionFactory { /** * Exponential distribution : P ( x ) = lambda * exp ( - lambda * x )
* @ param lambda Must be > 0
* @ param shape Shape of the output */
public SDVariable randomExponential ( double lambda , SDVariable shape ) { } } | return new RandomExponential ( sameDiff ( ) , shape , lambda ) . outputVariable ( ) ; |
public class DescribeVirtualInterfacesResult { /** * The virtual interfaces
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setVirtualInterfaces ( java . util . Collection ) } or { @ link # withVirtualInterfaces ( java . util . Collection ) } if
* you want ... | if ( this . virtualInterfaces == null ) { setVirtualInterfaces ( new com . amazonaws . internal . SdkInternalList < VirtualInterface > ( virtualInterfaces . length ) ) ; } for ( VirtualInterface ele : virtualInterfaces ) { this . virtualInterfaces . add ( ele ) ; } return this ; |
public class DynamoDBTableMapper { /** * Saves the object given into DynamoDB with the condition that the hash
* and , if applicable , the range key , already exist .
* @ param object The object to update .
* @ throws ConditionalCheckFailedException If the object does not exist .
* @ see com . amazonaws . servi... | final DynamoDBSaveExpression saveExpression = new DynamoDBSaveExpression ( ) ; for ( final DynamoDBMapperFieldModel < T , Object > key : model . keys ( ) ) { saveExpression . withExpectedEntry ( key . name ( ) , new ExpectedAttributeValue ( ) . withExists ( true ) . withValue ( key . convert ( key . get ( object ) ) ) ... |
public class GPSdEndpoint { /** * send command to GPSd and wait for response */
private < T extends IGPSObject > T syncCommand ( final String command , final Class < T > responseClass ) throws IOException { } } | synchronized ( this . asyncMutex ) { if ( out != null ) { this . out . write ( command + "\n" ) ; this . out . flush ( ) ; } if ( responseClass == WatchObject . class ) { lastWatch = command ; } while ( true ) { // wait for awaited message
// FIXME possible infinite loop if expected result arrives but new result overri... |
public class RequestHandler { /** * Executes all filters on controller and method level
* @ param annotations An array of @ FilterWith annotated classes and methods
* @ param response
* @ return True if the request should continue after filter execution , false otherwise
* @ throws NoSuchMethodException
* @ t... | for ( final Annotation annotation : annotations ) { final FilterWith filterWith = ( FilterWith ) annotation ; for ( final Class < ? > clazz : filterWith . value ( ) ) { if ( response . isEndResponse ( ) ) { return response ; } else { final Method classMethod = clazz . getMethod ( Default . FILTER_METHOD . toString ( ) ... |
public class CmsFormatterConfiguration { /** * Checks whether the given formatter bean matches the container types , width and nested flag . < p >
* @ param formatter the formatter bean
* @ param types the container types
* @ param width the container width
* @ return < code > true < / code > in case the format... | if ( formatter . isMatchAll ( ) ) { return true ; } if ( formatter . isTypeFormatter ( ) ) { return ! Sets . intersection ( types , formatter . getContainerTypes ( ) ) . isEmpty ( ) ; } else { return ( width == MATCH_ALL_CONTAINER_WIDTH ) || ( ( formatter . getMinWidth ( ) <= width ) && ( width <= formatter . getMaxWid... |
public class CacheableWorkspaceDataManager { /** * { @ inheritDoc } */
@ Override public List < PropertyData > getChildPropertiesData ( NodeData nodeData , List < QPathEntryFilter > itemDataFilters ) throws RepositoryException { } } | List < PropertyData > childs = getChildPropertiesDataByPattern ( nodeData , itemDataFilters ) ; for ( PropertyData prop : childs ) { fixPropertyValues ( prop ) ; } return childs ; |
public class JacksonDBCollection { /** * Get a collection for loading a reference of the given type
* @ param collectionName The name of the collection
* @ param type The type of the object
* @ param keyType the type of the id
* @ return The collection */
public < T , K > JacksonDBCollection < T , K > getRefere... | return getReferenceCollection ( new JacksonCollectionKey ( collectionName , type , keyType ) ) ; |
public class AWSApplicationDiscoveryClient { /** * Retrieves a list of servers that are one network hop away from a specified server .
* @ param listServerNeighborsRequest
* @ return Result of the ListServerNeighbors operation returned by the service .
* @ throws AuthorizationErrorException
* The AWS user accou... | request = beforeClientExecution ( request ) ; return executeListServerNeighbors ( request ) ; |
public class PQ { /** * Computes and returns the k nearest neighbors of the query internal id using the SDC approach .
* @ param k
* The number of nearest neighbors to be returned
* @ param iid
* The internal id of the query vector ( code actually )
* @ return A bounded priority queue of Result objects , whic... | BoundedPriorityQueue < Result > nn = new BoundedPriorityQueue < Result > ( new Result ( ) , k ) ; // find the product quantization code of the vector with the given id , i . e the centroid indices
int [ ] pqCodeQuery = new int [ numSubVectors ] ; for ( int m = 0 ; m < numSubVectors ; m ++ ) { if ( pqByteCodes != null )... |
public class OmidHBaseUtils { /** * Gets a handle of a specific table .
* @ param tableName of the table to be accessed .
* @ return HTable of the table found . */
@ Override public Object getTable ( String tableName ) { } } | logger . debug ( "OMID Begin of getTable for " + tableName ) ; TTable table = tableNameHandleMap . get ( tableName ) ; if ( table != null ) { logger . debug ( "OMIDE Found a cached handle for table " + tableName ) ; return table ; } try { table = new TTable ( this . getHbcfg ( ) , tableName ) ; } catch ( IOException e ... |
public class VpcPeeringConnectionVpcInfo { /** * Information about the IPv4 CIDR blocks for the VPC .
* @ param cidrBlockSet
* Information about the IPv4 CIDR blocks for the VPC . */
public void setCidrBlockSet ( java . util . Collection < CidrBlock > cidrBlockSet ) { } } | if ( cidrBlockSet == null ) { this . cidrBlockSet = null ; return ; } this . cidrBlockSet = new com . amazonaws . internal . SdkInternalList < CidrBlock > ( cidrBlockSet ) ; |
public class CmsXmlContent { /** * Returns < code > true < / code > if choice options exist for the given xpath in the selected locale . < p >
* In case the xpath does not select a nested choice content definition ,
* or in case the xpath does not exist at all , < code > false < / code > is returned . < p >
* @ p... | List < I_CmsXmlSchemaType > options = getChoiceOptions ( xpath , locale ) ; if ( ( options == null ) || ( options . size ( ) <= 1 ) ) { return false ; } return true ; |
public class AmazonElasticLoadBalancingClient { /** * Associates one or more security groups with your load balancer in a virtual private cloud ( VPC ) . The specified
* security groups override the previously associated security groups .
* For more information , see < a href =
* " http : / / docs . aws . amazon ... | request = beforeClientExecution ( request ) ; return executeApplySecurityGroupsToLoadBalancer ( request ) ; |
public class CertPathBuilder { /** * Returns the default { @ code CertPathBuilder } type as specified by
* the { @ code certpathbuilder . type } security property , or the string
* { @ literal " PKIX " } if no such property exists .
* < p > The default { @ code CertPathBuilder } type can be used by
* applicatio... | String cpbtype = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return Security . getProperty ( CPB_TYPE ) ; } } ) ; return ( cpbtype == null ) ? "PKIX" : cpbtype ; |
public class xen_upgrade { /** * < pre >
* Use this operation to upgrade XenServer .
* < / pre > */
public static xen_upgrade upgrade ( nitro_service client , xen_upgrade resource ) throws Exception { } } | return ( ( xen_upgrade [ ] ) resource . update_resource ( client ) ) [ 0 ] ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getESU ( ) { } } | if ( esuEClass == null ) { esuEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 328 ) ; } return esuEClass ; |
public class Main { /** * Parse arguments . */
public static String [ ] processOptions ( String args [ ] ) { } } | String usageError ; goodUsage : for ( int i = 0 ; ; ++ i ) { if ( i == args . length ) { return new String [ 0 ] ; } String arg = args [ i ] ; if ( ! arg . startsWith ( "-" ) ) { processStdin = false ; fileList . add ( arg ) ; mainModule = arg ; String [ ] result = new String [ args . length - i - 1 ] ; System . arrayc... |
public class SpriteUtil { /** * < p > Rotates a Sprite < / p >
* Note : If the angle is either 90 , 180 , 270 or - 90,
* { @ link io . github . aritzhack . aritzh . awt . util . SpriteUtil # rotate90 ( io . github . aritzhack . aritzh . awt . render . Sprite , io . github . aritzhack . aritzh . awt . util . SpriteU... | if ( angle == 90.0 ) return SpriteUtil . rotate90 ( original , Rotation . _90 ) ; else if ( angle == 180.0 ) return SpriteUtil . rotate90 ( original , Rotation . _180 ) ; else if ( angle == 270.0 || angle == - 90.0 ) return SpriteUtil . rotate90 ( original , Rotation . _270 ) ; final double radians = Math . toRadians (... |
public class SimpleBeanInfo { /** * Introspects the supplied class and returns a list of the Properties of
* the class .
* @ param methodDescriptors the method descriptors
* @ return The list of Properties as an array of PropertyDescriptors */
@ SuppressWarnings ( "unchecked" ) private List < PropertyDescriptor >... | // Get the list of public non - static methods into an array
if ( methodDescriptors == null ) { return null ; } HashMap < String , HashMap > propertyTable = new HashMap < > ( methodDescriptors . length ) ; // Search for methods that either get or set a Property
for ( Method methodDescriptor : methodDescriptors ) { intr... |
public class MojoExecutor { /** * Defines the plugin without its version
* @ param groupId The group id
* @ param artifactId The artifact id
* @ return The plugin instance */
public static Plugin plugin ( String groupId , String artifactId ) { } } | return plugin ( groupId , artifactId , null ) ; |
public class Planar { /** * Changes the image ' s width and height without declaring new memory . If the internal array
* is not large enough to store the new image an IllegalArgumentException is thrown .
* @ param width The new width .
* @ param height The new height . */
@ Override public void reshape ( int wid... | if ( this . width == width && this . height == height ) return ; if ( isSubimage ( ) ) throw new IllegalArgumentException ( "Can't reshape subimage" ) ; for ( int i = 0 ; i < bands . length ; i ++ ) { bands [ i ] . reshape ( width , height ) ; } this . startIndex = 0 ; this . stride = width ; this . width = width ; thi... |
public class FastStr { /** * Construct a FastStr instance from an iterator of characters
* @ param itr the character iterator
* @ return a FastStr instance consists of all chars in the iterator */
public static FastStr of ( Iterator < Character > itr ) { } } | StringBuilder sb = new StringBuilder ( ) ; while ( itr . hasNext ( ) ) { sb . append ( itr . next ( ) ) ; } return of ( sb ) ; |
public class ConnectedComponents { /** * Visit a vertex and mark it a member of component { @ code c } .
* @ param v vertex
* @ param c component */
private void visit ( int v , int c ) { } } | remaining -- ; component [ v ] = c ; for ( int w : g [ v ] ) if ( component [ w ] == 0 ) visit ( w , c ) ; |
public class CharOperation { /** * Answers a new array adding the second array at the end of first array . It answers null if the first and second
* are null . If the first array is null , then a new array char [ ] [ ] is created with second . If the second array is
* null , then the first array is returned . < br ... | if ( second == null ) { return first ; } if ( first == null ) { return new char [ ] [ ] { second } ; } int length = first . length ; char [ ] [ ] result = new char [ length + 1 ] [ ] ; System . arraycopy ( first , 0 , result , 0 , length ) ; result [ length ] = second ; return result ; |
public class ViSearch { /** * ( For testing ) Get insert status by insert trans id .
* @ param transId the id of the insert trans .
* @ return the insert trans */
@ Override public InsertStatus insertStatus ( String transId , Map < String , String > customParams ) { } } | return dataOperations . insertStatus ( transId , customParams ) ; |
public class ExcelFunctions { /** * Returns e raised to the power of number */
public static BigDecimal exp ( EvaluationContext ctx , Object number ) { } } | BigDecimal _number = Conversions . toDecimal ( number , ctx ) ; return ExpressionUtils . decimalPow ( E , _number ) ; |
public class PluginResourceImpl { /** * Loads a plugin registry from its URL . Will use the value in the
* cache if it exists . If not , it will connect to the remote URL and
* grab the registry JSON file .
* @ param registryUrl the URL of the registry */
private PluginRegistryBean loadRegistry ( URI registryUrl ... | PluginRegistryBean fromCache = registryCache . get ( registryUrl ) ; if ( fromCache != null ) { return fromCache ; } try { PluginRegistryBean registry = mapper . reader ( PluginRegistryBean . class ) . readValue ( registryUrl . toURL ( ) ) ; registryCache . put ( registryUrl , registry ) ; return registry ; } catch ( I... |
public class GitLabApiClient { /** * Perform an HTTP PUT call with the specified form data and URL , returning
* a ClientResponse instance with the data returned from the endpoint .
* @ param formData the Form containing the name / value pairs
* @ param url the fully formed path to the GitLab API endpoint
* @ r... | if ( formData instanceof GitLabApiForm ) return ( invocation ( url , null ) . put ( Entity . entity ( formData . asMap ( ) , MediaType . APPLICATION_FORM_URLENCODED_TYPE ) ) ) ; else return ( invocation ( url , null ) . put ( Entity . entity ( formData , MediaType . APPLICATION_FORM_URLENCODED_TYPE ) ) ) ; |
public class SamlIdPObjectEncrypter { /** * Build encrypter for saml object encrypter .
* @ param samlObject the saml object
* @ param service the service
* @ param adaptor the adaptor
* @ return the encrypter */
@ SneakyThrows protected Encrypter buildEncrypterForSamlObject ( final Object samlObject , final Sa... | val className = samlObject . getClass ( ) . getName ( ) ; val entityId = adaptor . getEntityId ( ) ; LOGGER . debug ( "Attempting to encrypt [{}] for [{}]" , className , entityId ) ; val credential = getKeyEncryptionCredential ( entityId , adaptor , service ) ; LOGGER . info ( "Found encryption public key: [{}]" , Enco... |
public class Project { /** * Add a Repository to the Project
* @ param url String
* @ throws ProjectException exception */
public void addRepository ( String url ) throws ProjectException { } } | List < Repository > repositories = getRepositories ( ) ; if ( repositories == null ) { repositories = new ArrayList < Repository > ( ) ; } try { Repository repository = RepoBuilder . repositoryFromUrl ( url ) ; repositories . add ( repository ) ; } catch ( MalformedURLException e ) { throw new ProjectException ( e ) ; ... |
public class DynamoDBv2ActionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DynamoDBv2Action dynamoDBv2Action , ProtocolMarshaller protocolMarshaller ) { } } | if ( dynamoDBv2Action == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dynamoDBv2Action . getRoleArn ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( dynamoDBv2Action . getPutItem ( ) , PUTITEM_BINDING ) ; } catch ( Exception e ) ... |
public class RedisTransporter { /** * - - - DISCONNECT - - - */
protected Promise disconnect ( ) { } } | int s = status . get ( ) ; if ( s != STATUS_DISCONNECTED && s != STATUS_DISCONNECTING ) { status . set ( STATUS_DISCONNECTING ) ; if ( clientSub != null ) { clientSub . disconnect ( ) ; } if ( clientPub != null ) { clientPub . disconnect ( ) ; } status . set ( STATUS_DISCONNECTED ) ; } return Promise . resolve ( ) ; |
public class ConfigFactory { /** * Like { @ link # parseResourcesAnySyntax ( ClassLoader , String , ConfigParseOptions ) } but always uses
* default parse options .
* @ param loader
* will be used to load resources
* @ param resourceBasename
* a resource name as in
* { @ link java . lang . ClassLoader # get... | return parseResourcesAnySyntax ( loader , resourceBasename , ConfigParseOptions . defaults ( ) ) ; |
public class Transforms { /** * Negative
* @ param ndArray
* @ param dup
* @ return */
public static INDArray neg ( INDArray ndArray , boolean dup ) { } } | return exec ( dup ? new Negative ( ndArray , ndArray . ulike ( ) ) : new Negative ( ndArray ) ) ; |
public class Predicates { /** * Returns a predicate that returns to true if the incoming request is an instance
* of the given request class .
* @ param < T > class of the request to evaluate against
* @ param requestType request type to evaluate against
* @ return true if the incoming request is an instance of... | return i -> requestType . isInstance ( i . getRequestEnvelope ( ) . getRequest ( ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.