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 from the finder cache
* @ return the matching commerce order , or < code > null < / code > if a matching commerce order could not be found */
public static CommerceOrder fetchByUUID_G ( String uuid , long groupId , boolean retrieveFromCache ) { } } | 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 ) } . */
public Type resolveType ( ParameterizedType type ) { } } | 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 [ ] resolvedTypeArguments = new Type [ unresolvedTypeArguments . length ] ; for ( int i = 0 ; i < unresolvedTypeArguments . length ; i ++ ) { Type resolvedType = unresolvedTypeArguments [ i ] ; if ( resolvedType instanceof TypeVariable < ? > ) { resolvedType = resolveType ( ( TypeVariable < ? > ) resolvedType ) ; } if ( resolvedType instanceof ParameterizedType ) { resolvedType = resolveType ( ( ParameterizedType ) resolvedType ) ; } resolvedTypeArguments [ i ] = resolvedType ; // This identity check is intentional . A different identity indicates that the type argument was resolved within # resolveType ( ) .
if ( unresolvedTypeArguments [ i ] != resolvedType ) { modified = true ; } } if ( modified ) { return new ParameterizedTypeImpl ( type . getRawType ( ) , resolvedTypeArguments , type . getOwnerType ( ) ) ; } else { return type ; } |
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 situation . */
private static OptimizedPlan getOptimizedPlan ( Optimizer compiler , JobWithJars prog , int parallelism ) throws CompilerException , ProgramInvocationException { } } | 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 ( ) ; else { CholeskyDecompositionCommon_DDRM decomp = new CholeskyDecompositionInner_DDRM ( true ) ; return new LinearSolverChol_DDRM ( decomp ) ; } } |
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 . */
public static String join ( Iterable < ? > objects , char separator ) { } } | 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 contentType , final long size , final InputStream is ) throws AtomException { } } | 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 ( ) ) ; while ( ( bytesRead = is . read ( buffer , 0 , 8192 ) ) != - 1 ) { bos . write ( buffer , 0 , bytesRead ) ; } } catch ( final Exception e ) { throw new AtomException ( "ERROR uploading file" , e ) ; } finally { try { bos . flush ( ) ; bos . close ( ) ; } catch ( final Exception ignored ) { } } |
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 */
@ Override @ Transactional ( enabled = false ) public CPRuleUserSegmentRel createCPRuleUserSegmentRel ( long CPRuleUserSegmentRelId ) { } } | 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 removed before returning < / li >
* < / ol >
* @ param params - a list to hold extracted arguments in the original string
* @ param original - a text string
* @ return the string with arguments replaced with " { } " */
public static String extractArguments ( List < String > params , String original ) { } } | 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 but < i > not < / i > in the remote config , the local fallback value will
* be returned . ( I . e . the remote and fallback config are merged and the remote config is given priority ) .
* @ param key The key of the config parameter .
* @ return the config value for the specified key or { @ code null } if the key
* was not found . */
public String getValue ( String key ) { } } | 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 .
* If < code > trimmedWord < / code > is titlecase , then < code > pluralizedWord < / code > is titlecased .
* @ param trimmedWord
* the input word , with leading and trailing whitespace removed
* @ param pluralizedWord
* the pluralized word
* @ return the < code > pluralizedWord < / code > after processing */
protected String postProcess ( String trimmedWord , String pluralizedWord ) { } } | 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 }
* and has to be checked and cast accordingly . The method will fail with an { @ link AssertionError } if no such
* authorizable exists .
* @ param authorizableId
* the id of the authorizable
* @ return the resolved { @ link org . apache . jackrabbit . api . security . user . Authorizable } . It is either a { @ link
* org . apache . jackrabbit . api . security . user . Group } or a { @ link org . apache . jackrabbit . api . security . user . User } .
* @ throws RepositoryException
* if the name was not found */
protected Authorizable resolveAuthorizable ( final String authorizableId ) throws RepositoryException { } } | 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 ( conn . closed ( ) ) { if ( null == toBeCleared ) { toBeCleared = new ArrayList < > ( ) ; } toBeCleared . add ( conn ) ; continue ; } visitor . apply ( conn ) ; } if ( null != toBeCleared ) { ConcurrentMap < WebSocketConnection , WebSocketConnection > originalCopy = registry . get ( key ) ; originalCopy . keySet ( ) . removeAll ( toBeCleared ) ; } } finally { lock . unlock ( ) ; } } |
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 , ( JsonRpcResponse ) msg ) ; } } catch ( Exception e ) { config . getErrorProcessor ( ) . onError ( session . getId ( ) , e ) ; } |
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 handleMessageReceived ( HttpRequestContext context , long bytes ) { } } | 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 ) , and will
* return null if it was not able to register the instance as default .
* @ return The single instance of this class , or null , if another
* Authenticator is allready registered as default . */
public static synchronized SimpleAuthenticator getInstance ( ) { } } | 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 . requestPasswordAuthentication ( null , FOURTYTWO , null , null , MAGIC ) ; // If this test returns false , we didn ' t succeed , so we set the
// instance back to null .
if ( pa == null || ! MAGIC . equals ( pa . getUserName ( ) ) || ! ( "" + FOURTYTWO ) . equals ( new String ( pa . getPassword ( ) ) ) ) { sInstance = null ; } // Done
sInitialized = true ; } return sInstance ; |
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 . execute ( ) ; } |
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 < String > source , Set < String > destination ) { } } | 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 and is ingored" , tag ) ; } else { destination . add ( tag ) ; } } return destination ; |
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 _ triggers " ) */
@ Nonnull public List < MavenArtifact > getGeneratedArtifacts ( @ Nonnull String jobFullName , @ Nonnull int buildNumber ) { } } | 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_ARTIFACT.ARTIFACT_ID" + " INNER JOIN JENKINS_BUILD AS UPSTREAM_BUILD ON GENERATED_MAVEN_ARTIFACT.BUILD_ID = UPSTREAM_BUILD.ID " + " INNER JOIN JENKINS_JOB AS UPSTREAM_JOB ON UPSTREAM_BUILD.JOB_ID = UPSTREAM_JOB.ID " + " WHERE " + " UPSTREAM_JOB.FULL_NAME = ? AND" + " UPSTREAM_JOB.JENKINS_MASTER_ID = ? AND" + " UPSTREAM_BUILD.NUMBER = ? " ; List < MavenArtifact > results = new ArrayList < > ( ) ; try ( Connection cnn = this . jdbcConnectionPool . getConnection ( ) ) { try ( PreparedStatement stmt = cnn . prepareStatement ( generatedArtifactsSql ) ) { stmt . setString ( 1 , jobFullName ) ; stmt . setLong ( 2 , getJenkinsMasterPrimaryKey ( cnn ) ) ; stmt . setInt ( 3 , buildNumber ) ; try ( ResultSet rst = stmt . executeQuery ( ) ) { while ( rst . next ( ) ) { MavenArtifact artifact = new MavenArtifact ( ) ; artifact . setGroupId ( rst . getString ( "maven_artifact.group_id" ) ) ; artifact . setArtifactId ( rst . getString ( "maven_artifact.artifact_id" ) ) ; artifact . setVersion ( rst . getString ( "maven_artifact.version" ) ) ; artifact . setType ( rst . getString ( "maven_artifact.type" ) ) ; artifact . setClassifier ( rst . getString ( "maven_artifact.classifier" ) ) ; artifact . setBaseVersion ( rst . getString ( "generated_maven_artifact.version" ) ) ; artifact . setRepositoryUrl ( rst . getString ( "generated_maven_artifact.repository_url" ) ) ; artifact . setExtension ( rst . getString ( "generated_maven_artifact.extension" ) ) ; artifact . setSnapshot ( artifact . getVersion ( ) . endsWith ( "-SNAPSHOT" ) ) ; // artifact . put ( " skip _ downstream _ triggers " , rst . getString ( " generated _ maven _ artifact . skip _ downstream _ triggers " ) ) ;
results . add ( artifact ) ; } } } } catch ( SQLException e ) { throw new RuntimeSqlException ( e ) ; } Collections . sort ( results ) ; return results ; |
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 TimeUnit } for < pre > time < / pre > to wait for thread - pools to shutdown */
public static void reset ( long time , TimeUnit unit ) { } } | // 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 you
* want to override the existing values .
* @ param transitGateways
* Information about the transit gateways .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeTransitGatewaysResult withTransitGateways ( TransitGateway ... transitGateways ) { } } | 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 .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void delete ( String resourceGroupName , String crossConnectionName , String peeringName ) { } } | 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 IOException { } } | 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 ; recalculateWordsInUse ( ) ; sizeIsSticky = ( words . length > 0 && words [ words . length - 1 ] == 0L ) ; // heuristic
checkInvariants ( ) ; |
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 < code > null < / code > )
* @ return the last matching cp definition grouped entry
* @ throws NoSuchCPDefinitionGroupedEntryException if a matching cp definition grouped entry could not be found */
@ Override public CPDefinitionGroupedEntry findByUuid_C_Last ( String uuid , long companyId , OrderByComparator < CPDefinitionGroupedEntry > orderByComparator ) throws NoSuchCPDefinitionGroupedEntryException { } } | 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 . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchCPDefinitionGroupedEntryException ( msg . toString ( ) ) ; |
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 ( dirProp == AN ) { return _AN ; } } return _ON ; |
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 ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . nSouthWest = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 2 , newChild ) ; } return true ; |
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 JGroupsSubsystemXMLWriter ( ) ) ; |
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 DeleteDeploymentConfig operation .
* @ return Result of the DeleteDeploymentConfig operation returned by the service .
* @ throws InvalidDeploymentConfigNameException
* The deployment configuration name was specified in an invalid format .
* @ throws DeploymentConfigNameRequiredException
* The deployment configuration name was not specified .
* @ throws DeploymentConfigInUseException
* The deployment configuration is still in use .
* @ throws InvalidOperationException
* An invalid operation was detected .
* @ sample AmazonCodeDeploy . DeleteDeploymentConfig
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codedeploy - 2014-10-06 / DeleteDeploymentConfig "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DeleteDeploymentConfigResult deleteDeploymentConfig ( DeleteDeploymentConfigRequest request ) { } } | 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
* If true , draw only the drawable ' s shadow . Otherwise , draw the drawable itself .
* @ param aMapOrientation */
protected synchronized static void drawAt ( final Canvas canvas , final Drawable drawable , final int x , final int y , final boolean shadow , final float aMapOrientation ) { } } | 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 ( WeekOfMonth . FOURTH . toString ( ) , Messages . GUI_SERIALDATE_WEEKDAYNUMBER_4_0 ) ; addCheckBox ( WeekOfMonth . LAST . toString ( ) , Messages . GUI_SERIALDATE_WEEKDAYNUMBER_5_0 ) ; |
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 BufferedInputStream ( proc . getInputStream ( ) ) ; BufferedOutputStream out = new BufferedOutputStream ( new FileOutputStream ( logFile ) ) ; int read = 0 ; byte [ ] bytes = new byte [ 1024 ] ; while ( ( read = inputStream . read ( bytes ) ) != - 1 ) { out . write ( bytes , 0 , read ) ; } inputStream . close ( ) ; out . flush ( ) ; out . close ( ) ; } proc . waitFor ( ) ; return proc ; } catch ( Exception e ) { String tail = "" ; try { tail = QFiles . tail ( logFile ) ; } catch ( Throwable t ) { // Ignore new exceptions
} throw new RuntimeException ( "Exception thrown while trying to exec command " + System . cmdToString ( cmdArray ) + "\n" + tail , e ) ; } |
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 >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > ALL ( ) < / b > < / i > < / div >
* < br / > */
public RTerminal ALL ( ) { } } | 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 ( annotations , io . qameta . allure . TmsLink . class , ResultsUtils :: createLink ) ) ; return result ; |
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 > & amp ; < / tt > , < tt > & quot ; < / tt > and < tt > & # 39 ; < / tt > . It is called
* < em > XML - style < / em > in order to link it with JSP ' s < tt > escapeXml < / tt > attribute in JSTL ' s
* < tt > & lt ; c : out . . . / & gt ; < / tt > tags .
* Note this method may < strong > not < / strong > produce the same results as
* { @ link # escapeHtml4Xml ( char [ ] , int , int , java . io . Writer ) } because
* it will escape the apostrophe as < tt > & amp ; apos ; < / tt > , whereas in HTML 4 such NCR does not exist
* ( the decimal numeric reference < tt > & amp ; # 39 ; < / tt > is used instead ) .
* This method calls { @ link # escapeHtml ( char [ ] , int , int , java . io . Writer , HtmlEscapeType , HtmlEscapeLevel ) }
* with the following preconfigured values :
* < ul >
* < li > < tt > type < / tt > :
* { @ link org . unbescape . html . HtmlEscapeType # HTML5 _ NAMED _ REFERENCES _ DEFAULT _ TO _ DECIMAL } < / li >
* < li > < tt > level < / tt > :
* { @ link org . unbescape . html . HtmlEscapeLevel # LEVEL _ 1 _ ONLY _ MARKUP _ SIGNIFICANT } < / li >
* < / ul >
* This method is < strong > thread - safe < / strong > .
* @ param text the < tt > char [ ] < / tt > to be escaped .
* @ param offset the position in < tt > text < / tt > at which the escape operation should start .
* @ param len the number of characters in < tt > text < / tt > that should be escaped .
* @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ throws IOException if an input / output exception occurs */
public static void escapeHtml5Xml ( final char [ ] text , final int offset , final int len , final Writer writer ) throws IOException { } } | 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 .
* @ param writer the < tt > java . io . Writer < / tt > to which the unescaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ throws IOException if an input / output exception occurs
* @ since 1.1.2 */
public static void unescapeCsv ( final Reader reader , final Writer writer ) throws IOException { } } | 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 . setInitParams ( initparams ) ; synchronized ( servletLock ) { container . getHandlerRegistry ( ) . addServlet ( handler ) ; this . localServlets . add ( servlet ) ; } |
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 . getResponseCard ( ) , RESPONSECARD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 AbstractBoundarySurfaceType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/tunnel/2.0" , name = "_BoundarySurface" , substitutionHeadNamespace = "http://www.opengis.net/citygml/2.0" , substitutionHeadName = "_CityObject" ) public JAXBElement < AbstractBoundarySurfaceType > create_BoundarySurface ( AbstractBoundarySurfaceType value ) { } } | 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 int minute , final int second ) { } } | 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 ( StringBuilder buffer , OutboundChannelDefinition ocd , int order ) throws NotSerializableException { } } | 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 . getOutboundFactory ( ) . getName ( ) ) ; buffer . append ( "\">\n" ) ; Map < Object , Object > props = ocd . getOutboundChannelProperties ( ) ; if ( null != props ) { for ( Entry < Object , Object > entry : props . entrySet ( ) ) { if ( null == entry . getValue ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property value [" + entry . getKey ( ) + "] is null, " + ocd . toString ( ) ) ; } throw new NotSerializableException ( "Property value for [" + entry . getKey ( ) + "] is null" ) ; } // TODO should pass around the one big stringbuffer instead
// of creating all these intermediate ones
StringBuilder kBuff = determineType ( "key" , entry . getKey ( ) ) ; if ( null != kBuff ) { StringBuilder vBuff = determineType ( "value" , entry . getValue ( ) ) ; if ( null != vBuff ) { buffer . append ( " <property " ) ; buffer . append ( kBuff ) ; buffer . append ( " " ) ; buffer . append ( vBuff ) ; buffer . append ( "/>\n" ) ; } } } } buffer . append ( " </channel>\n" ) ; return buffer ; |
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 ( mMonthTitleTypeface , Typeface . BOLD ) ) ; mMonthTitlePaint . setColor ( mDayTextColor ) ; mMonthTitlePaint . setTextAlign ( Align . CENTER ) ; mMonthTitlePaint . setStyle ( Style . FILL ) ; mSelectedCirclePaint = new Paint ( ) ; mSelectedCirclePaint . setFakeBoldText ( true ) ; mSelectedCirclePaint . setAntiAlias ( true ) ; mSelectedCirclePaint . setColor ( mTodayNumberColor ) ; mSelectedCirclePaint . setTextAlign ( Align . CENTER ) ; mSelectedCirclePaint . setStyle ( Style . FILL ) ; mSelectedCirclePaint . setAlpha ( SELECTED_CIRCLE_ALPHA ) ; mMonthDayLabelPaint = new Paint ( ) ; mMonthDayLabelPaint . setAntiAlias ( true ) ; mMonthDayLabelPaint . setTextSize ( MONTH_DAY_LABEL_TEXT_SIZE ) ; mMonthDayLabelPaint . setColor ( mMonthDayTextColor ) ; mMonthTitlePaint . setTypeface ( Typeface . create ( mDayOfWeekTypeface , Typeface . BOLD ) ) ; mMonthDayLabelPaint . setStyle ( Style . FILL ) ; mMonthDayLabelPaint . setTextAlign ( Align . CENTER ) ; mMonthDayLabelPaint . setFakeBoldText ( true ) ; mMonthNumPaint = new Paint ( ) ; mMonthNumPaint . setAntiAlias ( true ) ; mMonthNumPaint . setTextSize ( MINI_DAY_NUMBER_TEXT_SIZE ) ; mMonthNumPaint . setStyle ( Style . FILL ) ; mMonthNumPaint . setTextAlign ( Align . CENTER ) ; mMonthNumPaint . setFakeBoldText ( false ) ; |
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 < code > DetectDocumentText < / code > and
* < code > GetDocumentTextDetection < / code > .
* @ param entityTypes
* The type of entity . The following can be returned : < / p >
* < 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 < code > DetectDocumentText < / code > and
* < code > GetDocumentTextDetection < / code > .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see EntityType */
public Block withEntityTypes ( EntityType ... entityTypes ) { } } | 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 ( entityTypesCopy ) ; } return this ; |
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 ignored , Field field ) { } } | 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 < HBaseData > scanResults ( final String columnFamily , List < HBaseData > results ) throws IOException { } } | 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 ( values ) ; if ( results == null ) { results = new ArrayList < HBaseData > ( ) ; } results . add ( data ) ; } scanner = null ; resultsIter = null ; } return results ; |
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 to override the existing values .
* @ param virtualInterfaces
* The virtual interfaces
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeVirtualInterfacesResult withVirtualInterfaces ( VirtualInterface ... virtualInterfaces ) { } } | 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 . services . dynamodbv2 . datamodeling . DynamoDBMapper # save
* @ see com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBSaveExpression
* @ see com . amazonaws . services . dynamodbv2 . model . ExpectedAttributeValue */
public void saveIfExists ( T object ) throws ConditionalCheckFailedException { } } | 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 ) ) ) ) ; } mapper . < T > save ( object , saveExpression ) ; |
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 overrides expected result before getting to this point .
final IGPSObject result = this . waitForResult ( ) ; if ( ( result == null ) || result . getClass ( ) . equals ( responseClass ) ) { return responseClass . cast ( result ) ; } } } |
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
* @ throws IllegalAccessException
* @ throws InvocationTargetException */
protected Response executeFilter ( List < Annotation > annotations , Response response ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } } | 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 ( ) , Request . class , Response . class ) ; response = ( Response ) classMethod . invoke ( Application . getInstance ( clazz ) , this . attachment . getRequest ( ) , response ) ; } } } return response ; |
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 formatter matches */
public static boolean matchFormatter ( I_CmsFormatterBean formatter , Set < String > types , int width ) { } } | 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 . getMaxWidth ( ) ) ) ; } |
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 > getReferenceCollection ( String collectionName , JavaType type , JavaType keyType ) { } } | 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 account does not have permission to perform the action . Check the IAM policy associated with
* this account .
* @ throws InvalidParameterException
* One or more parameters are not valid . Verify the parameters and try again .
* @ throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range . Verify the parameter values and
* try again .
* @ throws ServerInternalErrorException
* The server experienced an internal error . Try again .
* @ sample AWSApplicationDiscovery . ListServerNeighbors */
@ Override public ListServerNeighborsResult listServerNeighbors ( ListServerNeighborsRequest request ) { } } | 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 , which contains the k nearest neighbors along with
* their iids and distances from the query vector , ordered by lowest distance . */
private BoundedPriorityQueue < Result > computeKnnSDC ( int k , int iid ) { } } | 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 ) { pqCodeQuery [ m ] = pqByteCodes . getQuick ( iid * numSubVectors + m ) ; } else { pqCodeQuery [ m ] = pqShortCodes . getQuick ( iid * numSubVectors + m ) ; } } double lowest = Double . MAX_VALUE ; for ( int i = 0 ; i < loadCounter ; i ++ ) { double l2distance = 0 ; for ( int j = 0 ; j < numSubVectors ; j ++ ) { int pqSubCode = pqByteCodes . getQuick ( i * numSubVectors + j ) ; int pqSubCodeQuery = pqCodeQuery [ j ] ; if ( pqByteCodes != null ) { // plus 128 because byte range is - 128 . . 127
pqSubCode += 128 ; pqSubCodeQuery += 128 ; } for ( int m = 0 ; m < subVectorLength ; m ++ ) { l2distance += ( productQuantizer [ j ] [ pqSubCode ] [ m ] - productQuantizer [ j ] [ pqSubCodeQuery ] [ m ] ) * ( productQuantizer [ j ] [ pqSubCode ] [ m ] - productQuantizer [ j ] [ pqSubCodeQuery ] [ m ] ) ; if ( l2distance > lowest ) { break ; // break the inner loop
} } if ( l2distance > lowest ) { break ; // break the outer loop
} } nn . offer ( new Result ( i , l2distance ) ) ; if ( i >= k ) { lowest = nn . last ( ) . getDistance ( ) ; } } return nn ; |
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 ) { logger . error ( "OMID Error trying to get a TransactionTable of OMID." ) ; logger . error ( e . getMessage ( ) ) ; } tableNameHandleMap . put ( tableName , table ) ; logger . debug ( "OMID Cached a handle of table: " + tableName ) ; return table ; |
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 >
* @ param xpath the xpath to check the choice options for
* @ param locale the locale to check
* @ return < code > true < / code > if choice options exist for the given xpath in the selected locale */
public boolean hasChoiceOptions ( String xpath , Locale locale ) { } } | 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 . com / elasticloadbalancing / latest / classic / elb - security - groups . html # elb - vpc - security - groups "
* > Security Groups for Load Balancers in a VPC < / a > in the < i > Classic Load Balancers Guide < / i > .
* @ param applySecurityGroupsToLoadBalancerRequest
* Contains the parameters for ApplySecurityGroupsToLoadBalancer .
* @ return Result of the ApplySecurityGroupsToLoadBalancer operation returned by the service .
* @ throws LoadBalancerNotFoundException
* The specified load balancer does not exist .
* @ throws InvalidConfigurationRequestException
* The requested configuration change is not valid .
* @ throws InvalidSecurityGroupException
* One or more of the specified security groups do not exist .
* @ sample AmazonElasticLoadBalancing . ApplySecurityGroupsToLoadBalancer
* @ see < a
* href = " http : / / docs . aws . amazon . com / goto / WebAPI / elasticloadbalancing - 2012-06-01 / ApplySecurityGroupsToLoadBalancer "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ApplySecurityGroupsToLoadBalancerResult applySecurityGroupsToLoadBalancer ( ApplySecurityGroupsToLoadBalancerRequest request ) { } } | 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
* applications that do not want to use a hard - coded type when calling one
* of the { @ code getInstance } methods , and want to provide a default
* type in case a user does not specify its own .
* < p > The default { @ code CertPathBuilder } type can be changed by
* setting the value of the { @ code certpathbuilder . type } security property
* to the desired type .
* @ see java . security . Security security properties
* @ return the default { @ code CertPathBuilder } type as specified
* by the { @ code certpathbuilder . type } security property , or the string
* { @ literal " PKIX " } if no such property exists . */
public final static String getDefaultType ( ) { } } | 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 . arraycopy ( args , i + 1 , result , 0 , args . length - i - 1 ) ; return result ; } if ( arg . equals ( "-version" ) ) { if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } int version ; try { version = Integer . parseInt ( args [ i ] ) ; } catch ( NumberFormatException ex ) { usageError = args [ i ] ; break goodUsage ; } if ( ! Context . isValidLanguageVersion ( version ) ) { usageError = args [ i ] ; break goodUsage ; } shellContextFactory . setLanguageVersion ( version ) ; continue ; } if ( arg . equals ( "-opt" ) || arg . equals ( "-O" ) ) { if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } int opt ; try { opt = Integer . parseInt ( args [ i ] ) ; } catch ( NumberFormatException ex ) { usageError = args [ i ] ; break goodUsage ; } if ( opt == - 2 ) { // Compatibility with Cocoon Rhino fork
opt = - 1 ; } else if ( ! Context . isValidOptimizationLevel ( opt ) ) { usageError = args [ i ] ; break goodUsage ; } shellContextFactory . setOptimizationLevel ( opt ) ; continue ; } if ( arg . equals ( "-encoding" ) ) { if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } String enc = args [ i ] ; shellContextFactory . setCharacterEncoding ( enc ) ; continue ; } if ( arg . equals ( "-strict" ) ) { shellContextFactory . setStrictMode ( true ) ; shellContextFactory . setAllowReservedKeywords ( false ) ; errorReporter . setIsReportingWarnings ( true ) ; continue ; } if ( arg . equals ( "-fatal-warnings" ) ) { shellContextFactory . setWarningAsError ( true ) ; continue ; } if ( arg . equals ( "-e" ) ) { processStdin = false ; if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } if ( ! global . initialized ) { global . init ( shellContextFactory ) ; } IProxy iproxy = new IProxy ( IProxy . EVAL_INLINE_SCRIPT ) ; iproxy . scriptText = args [ i ] ; shellContextFactory . call ( iproxy ) ; continue ; } if ( arg . equals ( "-require" ) ) { useRequire = true ; continue ; } if ( arg . equals ( "-sandbox" ) ) { sandboxed = true ; useRequire = true ; continue ; } if ( arg . equals ( "-modules" ) ) { if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } if ( modulePath == null ) { modulePath = new ArrayList < String > ( ) ; } modulePath . add ( args [ i ] ) ; useRequire = true ; continue ; } if ( arg . equals ( "-w" ) ) { errorReporter . setIsReportingWarnings ( true ) ; continue ; } if ( arg . equals ( "-f" ) ) { processStdin = false ; if ( ++ i == args . length ) { usageError = arg ; break goodUsage ; } if ( args [ i ] . equals ( "-" ) ) { fileList . add ( null ) ; } else { fileList . add ( args [ i ] ) ; mainModule = args [ i ] ; } continue ; } if ( arg . equals ( "-sealedlib" ) ) { global . setSealedStdLib ( true ) ; continue ; } if ( arg . equals ( "-debug" ) ) { shellContextFactory . setGeneratingDebug ( true ) ; continue ; } if ( arg . equals ( "-?" ) || arg . equals ( "-help" ) ) { // print usage message
global . getOut ( ) . println ( ToolErrorReporter . getMessage ( "msg.shell.usage" , Main . class . getName ( ) ) ) ; exitCode = 1 ; return null ; } usageError = arg ; break goodUsage ; } // print error and usage message
global . getOut ( ) . println ( ToolErrorReporter . getMessage ( "msg.shell.invalid" , usageError ) ) ; global . getOut ( ) . println ( ToolErrorReporter . getMessage ( "msg.shell.usage" , Main . class . getName ( ) ) ) ; exitCode = 1 ; return null ; |
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 . SpriteUtil . Rotation ) SpriteUtil . rotate90 ( Sprite , Rotation ) }
* will be used instead , since it is much faster
* @ param original The sprite to rotate
* @ param angle The rotation angle , in degrees
* @ return The rotated image */
public static Sprite rotate ( Sprite original , double angle ) { } } | 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 ( angle ) ; final double cos = Math . cos ( radians ) ; final double sin = Math . sin ( radians ) ; int newWidth = ( int ) ( cos * original . getWidth ( ) + sin * original . getHeight ( ) ) ; int newHeight = ( int ) ( cos * original . getHeight ( ) + sin * original . getWidth ( ) ) ; int xDelta = ( newWidth - original . getWidth ( ) ) / 2 ; int yDelta = ( newHeight - original . getHeight ( ) ) / 2 ; final int [ ] pixels2 = new int [ newWidth * newHeight ] ; int centerX = original . getWidth ( ) / 2 ; int centerY = original . getHeight ( ) / 2 ; for ( int x = - xDelta ; x < newWidth - xDelta ; x ++ ) for ( int y = - yDelta ; y < newHeight - yDelta ; y ++ ) { int m = x - centerX ; int n = y - centerY ; int j = ( int ) ( m * cos + n * sin + centerX ) ; int k = ( int ) ( n * cos - m * sin + centerY ) ; if ( j >= 0 && j < original . getWidth ( ) && k >= 0 && k < original . getHeight ( ) ) { pixels2 [ ( y + yDelta ) * newWidth + x + xDelta ] = original . getPixels ( ) [ k * original . getWidth ( ) + j ] ; } } return new Sprite ( newWidth , newHeight , pixels2 ) ; |
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 > introspectProperties ( Method [ ] methodDescriptors ) { } } | // 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 ) { introspectGet ( methodDescriptor , propertyTable ) ; introspectSet ( methodDescriptor , propertyTable ) ; } // fix possible getter & setter collisions
fixGetSet ( propertyTable ) ; // Put the properties found into the PropertyDescriptor array
ArrayList < PropertyDescriptor > propertyList = new ArrayList < > ( ) ; for ( Map . Entry < String , HashMap > entry : propertyTable . entrySet ( ) ) { String propertyName = entry . getKey ( ) ; HashMap table = entry . getValue ( ) ; if ( table == null ) { continue ; } String normalTag = ( String ) table . get ( STR_NORMAL ) ; if ( ( normalTag == null ) ) { continue ; } Method get = ( Method ) table . get ( STR_NORMAL + PREFIX_GET ) ; Method set = ( Method ) table . get ( STR_NORMAL + PREFIX_SET ) ; PropertyDescriptor propertyDesc = new PropertyDescriptor ( propertyName , get , set ) ; propertyList . add ( propertyDesc ) ; } return Collections . unmodifiableList ( propertyList ) ; |
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 width , int height ) { } } | 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 ; this . height = height ; |
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 >
* < br >
* For example :
* < ol >
* < li >
* < pre >
* first = null
* second = { ' a ' }
* = & gt ; result = { { ' a ' } }
* < / pre >
* < li >
* < pre >
* first = { { ' a ' } }
* second = null
* = & gt ; result = { { ' a ' } }
* < / pre >
* < / li >
* < li >
* < pre >
* first = { { ' a ' } }
* second = { ' b ' }
* = & gt ; result = { { ' a ' } , { ' b ' } }
* < / pre >
* < / li >
* < / ol >
* @ param first
* the first array to concatenate
* @ param second
* the array to add at the end of the first array
* @ return a new array adding the second array at the end of first array , or null if the two arrays are null . */
public static final char [ ] [ ] arrayConcat ( char [ ] [ ] first , char [ ] second ) { } } | 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 ( IOException e ) { return null ; } |
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
* @ return a ClientResponse instance with the data returned from the endpoint */
protected Response put ( Form formData , URL url ) { } } | 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 SamlRegisteredService service , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor ) { } } | 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: [{}]" , EncodingUtils . encodeBase64 ( credential . getPublicKey ( ) . getEncoded ( ) ) ) ; val keyEncParams = getKeyEncryptionParameters ( samlObject , service , adaptor , credential ) ; LOGGER . debug ( "Key encryption algorithm for [{}] is [{}]" , keyEncParams . getRecipient ( ) , keyEncParams . getAlgorithm ( ) ) ; val dataEncParams = getDataEncryptionParameters ( samlObject , service , adaptor ) ; LOGGER . debug ( "Data encryption algorithm for [{}] is [{}]" , entityId , dataEncParams . getAlgorithm ( ) ) ; val encrypter = getEncrypter ( samlObject , service , adaptor , keyEncParams , dataEncParams ) ; LOGGER . debug ( "Attempting to encrypt [{}] for [{}] with key placement of [{}]" , className , entityId , encrypter . getKeyPlacement ( ) ) ; return encrypter ; |
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 ) ; } getMavenModel ( ) . setRepositories ( repositories ) ; |
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 ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , 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 # getResource } , with or without
* extension
* @ return the parsed configuration */
public static Config parseResourcesAnySyntax ( ClassLoader loader , String resourceBasename ) { } } | 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 the given request class */
public static < T extends Request > Predicate < HandlerInput > requestType ( Class < T > requestType ) { } } | 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.