signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class StringPath { /** * Method to construct the equals expression for string
* @ param value the string value
* @ return Expression */
public Expression < String > eq ( String value ) { } } | String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . eq , valueString ) ; |
public class HttpCallUtils { /** * Sends a string to a URL . This is very helpful when SOAP web services are
* involved or you just want to post a XML message to a URL . If the
* connection requires basic authentication you can set the user name and
* password .
* @ param urlString
* the URL to post to
* @ ... | return this . doHttpCall ( urlString , fileUtil . getFileContentsAsString ( fileToBeSent , fileEncoding ) , userName , userPassword , "" , 0 , Collections . < String , String > emptyMap ( ) ) ; |
public class FischerRecognition { /** * Arrange the bonds adjacent to an atom ( focus ) in cardinal direction . The
* cardinal directions are that of a compass . Bonds are checked as to
* whether they are horizontal or vertical within a predefined threshold .
* @ param focus an atom
* @ param bonds bonds adjace... | final Point2d centerXy = focus . getPoint2d ( ) ; final IBond [ ] cardinal = new IBond [ 4 ] ; for ( final IBond bond : bonds ) { IAtom other = bond . getOther ( focus ) ; Point2d otherXy = other . getPoint2d ( ) ; double deltaX = otherXy . x - centerXy . x ; double deltaY = otherXy . y - centerXy . y ; // normalise ve... |
public class GpsTracesDao { /** * Upload a new trace with no tags
* @ see # create ( String , GpsTraceDetails . Visibility , String , List , Iterable ) */
public long create ( String name , GpsTraceDetails . Visibility visibility , String description , final Iterable < GpsTrackpoint > trackpoints ) { } } | return create ( name , visibility , description , null , trackpoints ) ; |
public class AnnotationIndexProcessor { /** * Process this deployment for annotations . This will use an annotation indexer to create an index of all annotations
* found in this deployment and attach it to the deployment unit context .
* @ param phaseContext the deployment unit context
* @ throws DeploymentUnitPr... | final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; for ( ResourceRoot resourceRoot : DeploymentUtils . allResourceRoots ( deploymentUnit ) ) { ResourceRootIndexer . indexResourceRoot ( resourceRoot ) ; } |
public class LocalDateCalculator { /** * Set the working week .
* @ param week the JodaWorkingWeek
* @ throws IllegalArgumentException if the week is not a JodaWorkingWeek . */
@ Override public DateCalculator < LocalDate > setWorkingWeek ( final WorkingWeek week ) { } } | if ( week instanceof Jdk8WorkingWeek ) { workingWeek = ( Jdk8WorkingWeek ) week ; return this ; } throw new IllegalArgumentException ( "Please give an instance of JodaWorkingWeek" ) ; |
public class ForeignKey { /** * Otherwise , it is a 1-1 relationship . */
public String getTableAMultiplicity ( ) { } } | String ret = "many" ; List < ColumnInfo > tableAPKs = tableA . getPkList ( ) ; if ( tableAPKs . size ( ) == 0 || tableA . getTableName ( ) . equals ( tableB . getTableName ( ) ) ) { return ret ; } if ( tableAB == null ) { List < ColumnInfo > fkColumns = this . getColumns ( ) ; Set < ColumnInfo > columnSet = new HashSet... |
public class StructrSessionDataStore { /** * - - - - - private methods - - - - - */
private void assertInitialized ( ) { } } | if ( ! services . isShuttingDown ( ) && ! services . isShutdownDone ( ) ) { // wait for service layer to be initialized
while ( ! services . isInitialized ( ) ) { try { Thread . sleep ( 1000 ) ; } catch ( Throwable t ) { } } } |
public class AbstractFileInfo { /** * Returns the root path which is either the absolute path or ( if any directory is set and { @ link # getSetRootPath ( ) } returns not null ) the path to the set - as - root path
* @ return absolute or prefix path for the set - as - root path if the file info object is valid and a ... | if ( this . isValid ( ) && this . setRootPath != null ) { return StringUtils . substringBefore ( this . getAbsolutePath ( ) , this . setRootPath ) ; } return null ; |
public class MetricUtils { /** * print default value for all metrics , in the format of : name | type | value */
public static void logMetrics ( MetricInfo metricInfo ) { } } | Map < String , Map < Integer , MetricSnapshot > > metrics = metricInfo . get_metrics ( ) ; if ( metrics != null ) { LOG . info ( "\nprint metrics:" ) ; for ( Map . Entry < String , Map < Integer , MetricSnapshot > > entry : metrics . entrySet ( ) ) { String name = entry . getKey ( ) ; MetricSnapshot metricSnapshot = en... |
public class CpnlElFunctions { /** * Returns the repository path of a child of a resource .
* @ param base the parent resource object
* @ param path the relative path to the child resource
* @ return the absolute path of the child if found , otherwise the original path value */
public static String child ( Resour... | Resource child = base . getChild ( path ) ; return child != null ? child . getPath ( ) : path ; |
public class RegistriesInner { /** * Lists the policies for the specified container registry .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ throws IllegalArgumentException thrown if parameters f... | return listPoliciesWithServiceResponseAsync ( resourceGroupName , registryName ) . map ( new Func1 < ServiceResponse < RegistryPoliciesInner > , RegistryPoliciesInner > ( ) { @ Override public RegistryPoliciesInner call ( ServiceResponse < RegistryPoliciesInner > response ) { return response . body ( ) ; } } ) ; |
public class Interval { /** * Converts the interval to an Integer array */
public int [ ] toIntArray ( ) { } } | final int [ ] result = new int [ this . size ( ) ] ; this . forEachWithIndex ( new IntIntProcedure ( ) { public void value ( int each , int index ) { result [ index ] = each ; } } ) ; return result ; |
public class JPAPersistenceManagerImpl { /** * Creates a PersistenceServiceUnit using the specified entity versions . */
private PersistenceServiceUnit createPsu ( int jobInstanceVersion , int jobExecutionVersion ) throws Exception { } } | return databaseStore . createPersistenceServiceUnit ( getJobInstanceEntityClass ( jobInstanceVersion ) . getClassLoader ( ) , getJobExecutionEntityClass ( jobExecutionVersion ) . getName ( ) , getJobInstanceEntityClass ( jobInstanceVersion ) . getName ( ) , StepThreadExecutionEntity . class . getName ( ) , StepThreadIn... |
public class ConcurrentBag { /** * Get a count of the number of items in the specified state at the time of this call .
* @ param state the state of the items to count
* @ return a count of how many items in the bag are in the specified state */
public int getCount ( final int state ) { } } | int count = 0 ; for ( IConcurrentBagEntry e : sharedList ) { if ( e . getState ( ) == state ) { count ++ ; } } return count ; |
public class StreamMessageImpl { /** * ( non - Javadoc )
* @ see javax . jms . Message # clearBody ( ) */
@ Override public void clearBody ( ) { } } | assertDeserializationLevel ( MessageSerializationLevel . FULL ) ; bodyIsReadOnly = false ; body . clear ( ) ; readPos = 0 ; currentByteInputStream = null ; |
public class FLUSH { /** * Returns a digest which contains , for all members of view , the highest delivered and received
* seqno of all digests */
protected static Digest maxSeqnos ( final View view , List < Digest > digests ) { } } | if ( view == null || digests == null ) return null ; MutableDigest digest = new MutableDigest ( view . getMembersRaw ( ) ) ; digests . forEach ( digest :: merge ) ; return digest ; |
public class QueueBasedSubscriber { /** * / * ( non - Javadoc )
* @ see org . reactivestreams . Subscriber # onComplete ( ) */
@ Override public void onComplete ( ) { } } | counter . active . decrementAndGet ( ) ; counter . subscription . removeValue ( subscription ) ; if ( queue != null && counter . active . get ( ) == 0 ) { if ( counter . completable ) { if ( counter . closing . compareAndSet ( false , true ) ) { counter . closed = true ; queue . addContinuation ( new Continuation ( ( )... |
public class Http2ReceiveListener { /** * Performs HTTP2 specification compliance check for headers and pseudo - headers of a current request .
* @ param headers map of the request headers
* @ return true if check was successful , false otherwise */
private boolean checkRequestHeaders ( HeaderMap headers ) { } } | // : method pseudo - header must be present always exactly one time ;
// HTTP2 request MUST NOT contain ' connection ' header
if ( headers . count ( METHOD ) != 1 || headers . contains ( Headers . CONNECTION ) ) { return false ; } // if CONNECT type is used , then we expect : method and : authority to be present only ;... |
public class DiskTypeClient { /** * Retrieves an aggregated list of disk types .
* < p > Sample code :
* < pre > < code >
* try ( DiskTypeClient diskTypeClient = DiskTypeClient . create ( ) ) {
* ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ;
* for ( DiskTypesScopedList element : diskTypeClient ... | AggregatedListDiskTypesHttpRequest request = AggregatedListDiskTypesHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return aggregatedListDiskTypes ( request ) ; |
public class DisassociateDeviceFromRoomRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DisassociateDeviceFromRoomRequest disassociateDeviceFromRoomRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( disassociateDeviceFromRoomRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateDeviceFromRoomRequest . getDeviceArn ( ) , DEVICEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marsha... |
public class UIResults { /** * Extract an Exception UIResults from the HttpServletRequest . Probably used
* by a . jsp responsible for actual drawing errors for the user . private
* @ param httpRequest the HttpServletRequest where the UIResults was
* ferreted away
* @ return Exception UIResult with info from ht... | UIResults results = ( UIResults ) httpRequest . getAttribute ( FERRET_NAME ) ; if ( results == null ) { throw new ServletException ( "No attribute.." ) ; } if ( results . exception == null ) { throw new ServletException ( "No WaybackException.." ) ; } if ( results . wbRequest == null ) { throw new ServletException ( "N... |
public class LineManager { /** * Create a list of lines on the map .
* Lines are going to be created only for features with a matching geometry .
* All supported properties are : < br >
* LineOptions . PROPERTY _ LINE _ JOIN - String < br >
* LineOptions . PROPERTY _ LINE _ OPACITY - Float < br >
* LineOption... | List < Feature > features = featureCollection . features ( ) ; List < LineOptions > options = new ArrayList < > ( ) ; if ( features != null ) { for ( Feature feature : features ) { LineOptions option = LineOptions . fromFeature ( feature ) ; if ( option != null ) { options . add ( option ) ; } } } return create ( optio... |
public class TranslatedPersonDictionary { /** * 时报包含key , 且key至少长length
* @ param key
* @ param length
* @ return */
public static boolean containsKey ( String key , int length ) { } } | if ( ! trie . containsKey ( key ) ) return false ; return key . length ( ) >= length ; |
public class ErrorReporter { /** * Issue a compilation note .
* @ param msg the text of the note
* @ param e the element to which it pertains */
void reportNote ( String msg , Element e ) { } } | messager . printMessage ( Diagnostic . Kind . NOTE , msg , e ) ; |
public class GroupByScan { /** * Moves to the next group . The key of the group is determined by the group
* values at the current record . The method repeatedly reads underlying
* records until it encounters a record having a different key . The
* aggregation functions are called for each record in the group . T... | if ( ! moreGroups ) return false ; if ( aggFns != null ) for ( AggregationFn fn : aggFns ) fn . processFirst ( ss ) ; groupVal = new GroupValue ( ss , groupFlds ) ; while ( moreGroups = ss . next ( ) ) { GroupValue gv = new GroupValue ( ss , groupFlds ) ; if ( ! groupVal . equals ( gv ) ) break ; if ( aggFns != null ) ... |
public class SqlBuilder { /** * 构造一个删除SQL
* @ param activeRecord ActiveRecord
* @ return 返回QueryMeta对象 */
static QueryMeta buildDeleteSql ( ActiveRecord activeRecord ) { } } | QueryMeta queryMeta = new QueryMeta ( ) ; StringBuilder sqlBuf = new StringBuilder ( "DELETE FROM " + activeRecord . getTableName ( ) ) ; int [ ] pos = { 1 } ; List < Object > list = parseWhere ( activeRecord , pos , sqlBuf ) ; if ( activeRecord . whereValues . isEmpty ( ) ) { throw new RuntimeException ( "Delete opera... |
public class CommerceNotificationTemplateUserSegmentRelPersistenceImpl { /** * Returns the first commerce notification template user segment rel in the ordered set where commerceNotificationTemplateId = & # 63 ; .
* @ param commerceNotificationTemplateId the commerce notification template ID
* @ param orderByCompar... | CommerceNotificationTemplateUserSegmentRel commerceNotificationTemplateUserSegmentRel = fetchByCommerceNotificationTemplateId_First ( commerceNotificationTemplateId , orderByComparator ) ; if ( commerceNotificationTemplateUserSegmentRel != null ) { return commerceNotificationTemplateUserSegmentRel ; } StringBundler msg... |
public class AbstractJSBlock { /** * Create a label , which can be referenced from < code > continue < / code > and
* < code > break < / code > statements .
* @ param sName
* name
* @ return this */
@ Nonnull public JSLabel label ( @ Nonnull @ Nonempty final String sName ) { } } | return addStatement ( new JSLabel ( sName ) ) ; |
public class Math { /** * Returns the smaller of two { @ code double } values . That
* is , the result is the value closer to negative infinity . If the
* arguments have the same value , the result is that same
* value . If either value is NaN , then the result is NaN . Unlike
* the numerical comparison operato... | if ( a != a ) return a ; // a is NaN
if ( ( a == 0.0d ) && ( b == 0.0d ) && ( Double . doubleToRawLongBits ( b ) == negativeZeroDoubleBits ) ) { // Raw conversion ok since NaN can ' t map to - 0.0.
return b ; } return ( a <= b ) ? a : b ; |
public class AccountFiltersInner { /** * Create or update an Account Filter .
* Creates or updates an Account Filter in the Media Services account .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param filter... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , accountName , filterName , parameters ) , serviceCallback ) ; |
public class CommerceAccountOrganizationRelUtil { /** * Returns the first commerce account organization rel in the ordered set where commerceAccountId = & # 63 ; .
* @ param commerceAccountId the commerce account ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code >... | return getPersistence ( ) . findByCommerceAccountId_First ( commerceAccountId , orderByComparator ) ; |
public class GoogleHadoopFileSystemBase { /** * Opens the given file for reading .
* < p > Note : This function overrides the given bufferSize value with a higher number unless further
* overridden using configuration parameter { @ code fs . gs . inputstream . buffer . size } .
* @ param hadoopPath File to open .... | long startTime = System . nanoTime ( ) ; Preconditions . checkArgument ( hadoopPath != null , "hadoopPath must not be null" ) ; checkOpen ( ) ; logger . atFine ( ) . log ( "GHFS.open: %s, bufferSize: %d (ignored)" , hadoopPath , bufferSize ) ; URI gcsPath = getGcsPath ( hadoopPath ) ; GoogleCloudStorageReadOptions read... |
public class WorkWrapper { /** * Calls listener after work context is setted up .
* @ param listener work context listener */
private void fireWorkContextSetupComplete ( Object workContext ) { } } | if ( workContext != null && workContext instanceof WorkContextLifecycleListener ) { if ( trace ) log . tracef ( "WorkContextSetupComplete(%s) for %s" , workContext , this ) ; WorkContextLifecycleListener listener = ( WorkContextLifecycleListener ) workContext ; listener . contextSetupComplete ( ) ; } |
public class DefaultLogWatch { /** * Notify { @ link MessageConsumer } s of a message that is
* { @ link MessageDeliveryStatus # INCOMING } .
* @ param message
* The message in question .
* @ return True if the message was passed to { @ link MessageConsumer } s , false
* if stopped at the gate by
* { @ link... | if ( ! this . hasToLetMessageThroughTheGate ( message ) ) { return false ; } this . consumers . messageReceived ( message , MessageDeliveryStatus . INCOMING , this ) ; return true ; |
public class ChannelBuffer { /** * Returns a promise of the { @ code head } index of
* the { @ code buffer } if it is not empty .
* If this buffer will be exhausted after this
* take and { @ code put } promise is not { @ code null } ,
* { @ code put } will be set { @ code null } after the poll .
* Current { @... | assert take == null ; if ( exception == null ) { if ( put != null && willBeExhausted ( ) ) { assert ! isEmpty ( ) ; T item = doPoll ( ) ; SettablePromise < Void > put = this . put ; this . put = null ; put . set ( null ) ; return Promise . of ( item ) ; } if ( ! isEmpty ( ) ) { return Promise . of ( doPoll ( ) ) ; } ta... |
public class ListDeploymentsResult { /** * A list of deployments for the requested groups .
* @ param deployments
* A list of deployments for the requested groups . */
public void setDeployments ( java . util . Collection < Deployment > deployments ) { } } | if ( deployments == null ) { this . deployments = null ; return ; } this . deployments = new java . util . ArrayList < Deployment > ( deployments ) ; |
public class FileUtils { /** * Read the last few lines of a file
* @ param file the source file
* @ param lines the number of lines to read
* @ return the String result */
public static String tail2 ( File file , int lines ) { } } | lines ++ ; // Read # lines inclusive
java . io . RandomAccessFile fileHandler = null ; try { fileHandler = new java . io . RandomAccessFile ( file , "r" ) ; long fileLength = fileHandler . length ( ) - 1 ; StringBuilder sb = new StringBuilder ( ) ; int line = 0 ; for ( long filePointer = fileLength ; filePointer != - 1... |
public class ConfigurationModule { /** * Convert Configuration to a list of strings formatted as " param = value " .
* @ param c
* @ return */
private static List < String > toConfigurationStringList ( final Configuration c ) { } } | final ConfigurationImpl conf = ( ConfigurationImpl ) c ; final List < String > l = new ArrayList < > ( ) ; for ( final ClassNode < ? > opt : conf . getBoundImplementations ( ) ) { l . add ( opt . getFullName ( ) + '=' + escape ( conf . getBoundImplementation ( opt ) . getFullName ( ) ) ) ; } for ( final ClassNode < ? >... |
public class JDBC4DatabaseMetaData { /** * Retrieves the catalog names available in this database . */
@ Override public ResultSet getCatalogs ( ) throws SQLException { } } | checkClosed ( ) ; VoltTable result = new VoltTable ( new VoltTable . ColumnInfo ( "TABLE_CAT" , VoltType . STRING ) ) ; result . addRow ( new Object [ ] { catalogString } ) ; return new JDBC4ResultSet ( null , result ) ; |
public class ItemResponseMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ItemResponse itemResponse , ProtocolMarshaller protocolMarshaller ) { } } | if ( itemResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( itemResponse . getItem ( ) , ITEM_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class EnrollmentRequest { /** * Convert the enrollment request to a JSON object */
private JsonObject toJsonObject ( ) { } } | JsonObjectBuilder factory = Json . createObjectBuilder ( ) ; if ( profile != null ) { factory . add ( "profile" , profile ) ; } if ( ! hosts . isEmpty ( ) ) { JsonArrayBuilder ab = Json . createArrayBuilder ( ) ; for ( String host : hosts ) { ab . add ( host ) ; } factory . add ( "hosts" , ab . build ( ) ) ; } if ( lab... |
public class TorrentHandle { /** * The name of the torrent . Typically this is derived from the
* . torrent file . In case the torrent was started without metadata ,
* and hasn ' t completely received it yet , it returns the name given
* to it when added to the session .
* @ return the name */
public String nam... | torrent_status ts = th . status ( torrent_handle . query_name ) ; return ts . getName ( ) ; |
public class StoredProcedureInvocation { /** * Hack for SyncSnapshotBuffer . Note that this is using the ORIGINAL ( version 0 ) serialization format .
* Moved to this file from that one so you might see it sooner than I did .
* If you change the serialization , you have to change this too . */
public static int get... | // code below is used to compute the right value slowly
/* StoredProcedureInvocation spi = new StoredProcedureInvocation ( ) ;
spi . setProcName ( " @ LoadVoltTableSP " ) ;
if ( isPartitioned ) {
spi . setParams ( 0 , catTable . getTypeName ( ) , null ) ;
else {
spi . setParams ( 0 , catTable . getTypeName ( ... |
public class HivePurgerQueryTemplate { /** * Will return all the queries needed to have a backup table partition pointing to the original partition data location */
public static List < String > getBackupQueries ( PurgeableHivePartitionDataset dataset ) { } } | List < String > queries = new ArrayList < > ( ) ; queries . add ( getUseDbQuery ( dataset . getDbName ( ) ) ) ; queries . add ( getCreateTableQuery ( dataset . getCompleteBackupTableName ( ) , dataset . getDbName ( ) , dataset . getTableName ( ) , dataset . getBackupTableLocation ( ) ) ) ; Optional < String > fileForma... |
public class CacheManagerBuilder { /** * Adds a { @ link OffHeapDiskStoreProviderConfiguration } , that specifies the thread pool to use , to the returned
* builder .
* @ param threadPoolAlias the thread pool alias
* @ return a new builder with the added configuration
* @ see PooledExecutionServiceConfiguration... | OffHeapDiskStoreProviderConfiguration config = configBuilder . findServiceByClass ( OffHeapDiskStoreProviderConfiguration . class ) ; if ( config == null ) { return new CacheManagerBuilder < > ( this , configBuilder . addService ( new OffHeapDiskStoreProviderConfiguration ( threadPoolAlias ) ) ) ; } else { Configuratio... |
public class NativeExecutionQueryImpl { /** * results / / / / / */
public List < Execution > executeList ( CommandContext commandContext , Map < String , Object > parameterMap , int firstResult , int maxResults ) { } } | return commandContext . getExecutionEntityManager ( ) . findExecutionsByNativeQuery ( parameterMap , firstResult , maxResults ) ; |
public class ResponseBuilder { /** * Build a { @ link Response } from the request , offset , limit , total and list of elements .
* @ param request The { @ link javax . servlet . http . HttpServletRequest } which was executed .
* @ param offset The offset of the results .
* @ param limit The maximum number of res... | checkArgument ( offset >= 0 ) ; checkArgument ( limit >= 1 ) ; checkArgument ( total >= 0 ) ; checkArgument ( total == 0 || offset < total ) ; String requestUri = request . getRequestURI ( ) ; String queryString = request . getQueryString ( ) ; String href = requestUri + ( ! Strings . isNullOrEmpty ( queryString ) ? "?... |
public class Util { /** * Obtain the match url given the query row and the kind of discovery
* we are carrying out
* @ param row the result from a SPARQL query
* @ param operationDiscovery true if we are doing operation discovery
* @ return the URL for the match result */
public static URL getMatchUrl ( QuerySo... | // Check the input and return immediately if null
if ( row == null ) { return null ; } URL matchUrl ; if ( operationDiscovery ) { matchUrl = Util . getOperationUrl ( row ) ; } else { matchUrl = Util . getServiceUrl ( row ) ; } return matchUrl ; |
public class SeaGlassLookAndFeel { /** * Initialize the tool bar settings .
* @ param d the UI defaults map . */
private void defineToolBars ( UIDefaults d ) { } } | // Copied from nimbus
d . put ( "ToolBar.contentMargins" , new InsetsUIResource ( 2 , 2 , 2 , 2 ) ) ; d . put ( "ToolBar.opaque" , Boolean . TRUE ) ; d . put ( "ToolBar:Button.contentMargins" , new InsetsUIResource ( 4 , 4 , 4 , 4 ) ) ; d . put ( "ToolBar:ToggleButton.contentMargins" , new InsetsUIResource ( 4 , 4 , 4 ... |
public class LinkHandler { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . DestinationHandler # isLink ( ) */
public boolean isLink ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isLink" ) ; SibTr . exit ( tc , "isLink" , Boolean . valueOf ( true ) ) ; } return true ; |
public class ExecutionVertex { /** * Gets the preferred location to execute the current task execution attempt , based on the state
* that the execution attempt will resume .
* @ return A size - one collection with the location preference , or null , if there is no
* location preference based on the state . */
pu... | TaskManagerLocation priorLocation ; if ( currentExecution . getTaskRestore ( ) != null && ( priorLocation = getLatestPriorLocation ( ) ) != null ) { return Collections . singleton ( CompletableFuture . completedFuture ( priorLocation ) ) ; } else { return null ; } |
public class CmsContainerpageController { /** * Creates a new element . < p >
* @ param element the widget belonging to the element which is currently in memory only
* @ param callback the callback to call with the result */
public void createNewElement ( final CmsContainerPageElementPanel element , final AsyncCall... | CmsRpcAction < CmsContainerElement > action = new CmsRpcAction < CmsContainerElement > ( ) { @ Override public void execute ( ) { getContainerpageService ( ) . createNewElement ( CmsCoreProvider . get ( ) . getStructureId ( ) , element . getId ( ) , element . getNewType ( ) , null , getLocale ( ) , this ) ; } @ Overrid... |
public class Matrix4f { /** * Set the upper left 3x3 submatrix of this { @ link Matrix4f } to the given { @ link Matrix3fc }
* and the rest to identity .
* @ see # Matrix4f ( Matrix3fc )
* @ param mat
* the { @ link Matrix3fc }
* @ return this */
public Matrix4f set ( Matrix3fc mat ) { } } | if ( mat instanceof Matrix3f ) { MemUtil . INSTANCE . copy ( ( Matrix3f ) mat , this ) ; } else { setMatrix3fc ( mat ) ; } this . _properties ( PROPERTY_AFFINE ) ; return this ; |
public class QuickDiagnose { /** * Uses the { @ code matcher } to validate { @ code item } .
* If validation fails , an error message is stored in { @ code mismatch } .
* The code is equivalent to
* < pre > { @ code
* if ( matcher . matches ( item ) ) {
* return true ;
* } else {
* matcher . describeMisma... | if ( mismatch instanceof Description . NullDescription ) { return matcher . matches ( item ) ; } if ( matcher instanceof QuickDiagnosingMatcher ) { return ( ( QuickDiagnosingMatcher < ? > ) matcher ) . matches ( item , mismatch ) ; } else if ( matcher instanceof DiagnosingMatcher ) { return DiagnosingHack . matches ( m... |
public class RawValueJsonSerializer { /** * { @ inheritDoc } */
@ Override protected void doSerialize ( JsonWriter writer , Object value , JsonSerializationContext ctx , JsonSerializerParameters params ) { } } | writer . rawValue ( value ) ; |
public class InnerClassVisitor { /** * passed as the first argument implicitly . */
private void passThisReference ( ConstructorCallExpression call ) { } } | ClassNode cn = call . getType ( ) . redirect ( ) ; if ( ! shouldHandleImplicitThisForInnerClass ( cn ) ) return ; boolean isInStaticContext = true ; if ( currentMethod != null ) isInStaticContext = currentMethod . getVariableScope ( ) . isInStaticContext ( ) ; else if ( currentField != null ) isInStaticContext = curren... |
public class StringEscapeUtilities { /** * Removes all the occurrences of the \ < toRemove > characters from the < string >
* @ param string the string from which to remove the characters
* @ param toRemove the \ character to remove from the < string >
* @ return a new string with the removed \ < toRemove > chara... | String toReturn = string ; for ( char character : toRemove ) { toReturn = removeEscapedChar ( toReturn , character ) ; } return toReturn ; |
public class FDSPutObjectRequest { /** * Auto convert inputStream to FDSProgressInputStream in order to invoke progress listener
* @ param inputStream
* @ param inputStreamLength the length of inputStream , set - 1 if the length is uncertain */
public void setInputStream ( InputStream inputStream , long inputStream... | // close last file when set a new inputStream
if ( this . isUploadFile ) { try { this . inputStream . close ( ) ; } catch ( Exception e ) { } } if ( inputStream instanceof FDSProgressInputStream ) { this . inputStream = ( FDSProgressInputStream ) inputStream ; } else { this . inputStream = new FDSProgressInputStream ( ... |
public class ALTaskTextViewerPanel { /** * Updates the graph based on the information given by the preview .
* @ param preview information used to update the graph
* @ param colors color coding used to connect the tasks with the graphs */
@ SuppressWarnings ( "unchecked" ) public void setGraph ( Preview preview , C... | if ( preview == null ) { // no preview received
this . measureOverview . update ( null , "" , null ) ; this . graphCanvas . setGraph ( null , null , null , 1000 , null ) ; this . paramGraphCanvas . setGraph ( null , null , null , null ) ; this . budgetGraphCanvas . setGraph ( null , null , null , null ) ; return ; } Pa... |
public class Any { /** * The media type used for encoding . There will need to exist a serializer
* registered for this . If the media type is not set , it is assumed to be
* & # 39 ; application / vnd . apache . thrift . binary & # 39 ; , the default thrift serialization .
* @ return Optional of the < code > med... | return java . util . Optional . ofNullable ( mMediaType ) ; |
public class Status { /** * Returns the URI of the specification describing the status .
* @ return The URI of the specification describing the status . */
public String getUri ( ) { } } | String result = this . uri ; if ( result == null ) { switch ( this . code ) { case 100 : result = BASE_HTTP + "#sec10.1.1" ; break ; case 101 : result = BASE_HTTP + "#sec10.1.2" ; break ; case 102 : result = BASE_WEBDAV + "#STATUS_102" ; break ; case 200 : result = BASE_HTTP + "#sec10.2.1" ; break ; case 201 : result =... |
public class JNRPEProtocolPacketV2 { /** * Sets the value of the data buffer .
* @ param buffer the buffer value */
public void setBuffer ( final String buffer ) { } } | initRandomBuffer ( ) ; byteBufferAry = Arrays . copyOf ( buffer . getBytes ( ) , MAX_PACKETBUFFER_LENGTH ) ; |
public class SpewGenerator { /** * Returns a random line of text , driven by the underlying spew file and the given
* classes . For example , to drive a spew file but add some parameters to it ,
* call this method with the class names as the map keys , and the Strings that you ' d
* like substituted as the values... | return mainClass . render ( null , preprocessExtraClasses ( extraClasses ) ) ; |
public class CommonProfile { /** * Return the gender of the user .
* @ return the gender of the user */
public Gender getGender ( ) { } } | final Gender gender = ( Gender ) getAttribute ( CommonProfileDefinition . GENDER ) ; if ( gender == null ) { return Gender . UNSPECIFIED ; } else { return gender ; } |
public class TrueTypeFont { /** * Gets a glyph width .
* @ param glyph the glyph to get the width of
* @ return the width of the glyph in normalized 1000 units */
protected int getGlyphWidth ( int glyph ) { } } | if ( glyph >= GlyphWidths . length ) glyph = GlyphWidths . length - 1 ; return GlyphWidths [ glyph ] ; |
public class RouteProcessor { /** * Sort metas in group .
* @ param routeMete metas . */
private void categories ( RouteMeta routeMete ) { } } | if ( routeVerify ( routeMete ) ) { logger . info ( ">>> Start categories, group = " + routeMete . getGroup ( ) + ", path = " + routeMete . getPath ( ) + " <<<" ) ; Set < RouteMeta > routeMetas = groupMap . get ( routeMete . getGroup ( ) ) ; if ( CollectionUtils . isEmpty ( routeMetas ) ) { Set < RouteMeta > routeMetaSe... |
public class MapBasedJobFactory { /** * Verify the given job types are all valid .
* @ param jobTypes the given job types
* @ throws IllegalArgumentException if any of the job types are invalid
* @ see # checkJobType ( String , Class ) */
protected void checkJobTypes ( final Map < String , ? extends Class < ? > >... | if ( jobTypes == null ) { throw new IllegalArgumentException ( "jobTypes must not be null" ) ; } for ( final Entry < String , ? extends Class < ? > > entry : jobTypes . entrySet ( ) ) { try { checkJobType ( entry . getKey ( ) , entry . getValue ( ) ) ; } catch ( IllegalArgumentException iae ) { throw new IllegalArgumen... |
public class ShutdownHookUtil { /** * Removes a shutdown hook from the JVM . */
public static void removeShutdownHook ( final Thread shutdownHook , final String serviceName , final Logger logger ) { } } | // Do not run if this is invoked by the shutdown hook itself
if ( shutdownHook == null || shutdownHook == Thread . currentThread ( ) ) { return ; } checkNotNull ( logger ) ; try { Runtime . getRuntime ( ) . removeShutdownHook ( shutdownHook ) ; } catch ( IllegalStateException e ) { // race , JVM is in shutdown already ... |
public class SimpleJCRUserListAccess { /** * { @ inheritDoc } */
protected int getSize ( Session session ) throws Exception { } } | long result = usersStorageNode . getNodesCount ( ) ; if ( status != UserStatus . ANY ) { StringBuilder statement = new StringBuilder ( "SELECT * FROM " ) ; statement . append ( JCROrganizationServiceImpl . JOS_USERS_NODETYPE ) . append ( " WHERE" ) ; statement . append ( " jcr:path LIKE '" ) . append ( usersStorageNode... |
public class CauchyStochasticLaw { /** * Replies the x according to the value of the distribution function .
* @ param u is a value given by the uniform random variable generator { @ code U ( 0 , 1 ) } .
* @ return { @ code F < sup > - 1 < / sup > ( u ) }
* @ throws MathException in case { @ code F < sup > - 1 < ... | return this . x0 + this . gamma * Math . tan ( Math . PI * ( u - .5 ) ) ; |
public class Pattern { /** * Changes a label . The oldLabel has to be an existing label and new label has to be a new
* label .
* @ param oldLabel label to update
* @ param newLabel updated label */
public void updateLabel ( String oldLabel , String newLabel ) { } } | if ( hasLabel ( newLabel ) ) throw new IllegalArgumentException ( "The label \"" + newLabel + "\" already exists." ) ; int i = indexOf ( oldLabel ) ; labelMap . remove ( oldLabel ) ; labelMap . put ( newLabel , i ) ; |
public class ComplexImg { /** * Fills the specified channel with the specified value .
* All values of this channel will be same afterwards .
* < br >
* If { @ link # isSynchronizePowerSpectrum ( ) } is true , then this will also
* call { @ link # recomputePowerChannel ( ) } .
* @ param channel to fill
* @ ... | delegate . fill ( channel , value ) ; if ( synchronizePowerSpectrum && ( channel == CHANNEL_REAL || channel == CHANNEL_IMAG ) ) { recomputePowerChannel ( ) ; } return this ; |
public class AlignerHelper { /** * Find alignment path through traceback matrix
* @ param traceback
* @ param local
* @ param xyMax
* @ param last
* @ param sx
* @ param sy
* @ return */
public static int [ ] setSteps ( Last [ ] [ ] [ ] traceback , boolean local , int [ ] xyMax , Last last , List < Step >... | int x = xyMax [ 0 ] , y = xyMax [ 1 ] ; boolean linear = ( traceback [ x ] [ y ] . length == 1 ) ; while ( local ? ( linear ? last : traceback [ x ] [ y ] [ last . ordinal ( ) ] ) != null : x > 0 || y > 0 ) { switch ( last ) { case DELETION : sx . add ( Step . COMPOUND ) ; sy . add ( Step . GAP ) ; last = linear ? trac... |
public class SDMath { /** * Generate an identity matrix with the specified number of rows and columns , with optional leading dims < br >
* Example : < br >
* batchShape : [ 3,3 ] < br >
* numRows : 2 < br >
* numCols : 4 < br >
* returns a tensor of shape ( 3 , 3 , 2 , 4 ) that consists of 3 * 3 batches of (... | SDVariable eye = new Eye ( sd , rows , cols , dataType , batchDimension ) . outputVariables ( ) [ 0 ] ; return updateVariableNameAndReference ( eye , name ) ; |
public class AbstractMetricCollectingInterceptor { /** * Creates a new timer function using the given template . This method initializes the default timers .
* @ param timerTemplate The template to create the instances from .
* @ return The newly created function that returns a timer for a given code . */
protected... | final Map < Code , Timer > cache = new EnumMap < > ( Code . class ) ; final Function < Code , Timer > creator = code -> timerTemplate . get ( ) . tag ( TAG_STATUS_CODE , code . name ( ) ) . register ( this . registry ) ; final Function < Code , Timer > cacheResolver = code -> cache . computeIfAbsent ( code , creator ) ... |
public class BitMatrix { /** * Modifies this { @ code BitMatrix } to represent the same but rotated 180 degrees */
public void rotate180 ( ) { } } | int width = getWidth ( ) ; int height = getHeight ( ) ; BitArray topRow = new BitArray ( width ) ; BitArray bottomRow = new BitArray ( width ) ; for ( int i = 0 ; i < ( height + 1 ) / 2 ; i ++ ) { topRow = getRow ( i , topRow ) ; bottomRow = getRow ( height - 1 - i , bottomRow ) ; topRow . reverse ( ) ; bottomRow . rev... |
public class FreezeHandler { /** * Overrides < code > endElement ( ) < / code > in
* < code > org . xml . sax . helpers . DefaultHandler < / code > ,
* which in turn implements < code > org . xml . sax . ContentHandler < / code > .
* Called for each start tag encountered . */
public void endElement ( String names... | currentElement = null ; currentDepth -- ; String indentation = indent ( - 1 ) ; String closingElement = "</" + getName ( localName , qualifiedName ) + ">" ; write ( currentlyInLeafElement ? closingElement : nl + indentation + closingElement ) ; currentlyInLeafElement = false ; this . currentElement = null ; if ( frozen... |
public class DefaultOverlayService { /** * { @ inheritDoc }
* @ see # uninstallOverlay ( JComponent , JComponent , Insets ) */
public Boolean uninstallOverlay ( JComponent targetComponent , JComponent overlay ) { } } | this . uninstallOverlay ( targetComponent , overlay , null ) ; return Boolean . TRUE ; |
public class ModelNodeFormBuilder { /** * Adds a validator to the form , to require at least one of them to be filled .
* Requires use of createValidators ( true ) */
public ModelNodeFormBuilder requiresAtLeastOne ( String ... attributeName ) { } } | if ( attributeName != null && attributeName . length != 0 ) { this . requiresAtLeastOne . addAll ( asList ( attributeName ) ) ; } return this ; |
public class ValidatingStreamReader { /** * Public API , configuration */
@ Override public Object getProperty ( String name ) { } } | // DTD - specific properties . . .
if ( name . equals ( STAX_PROP_ENTITIES ) ) { safeEnsureFinishToken ( ) ; if ( mDTD == null || ! ( mDTD instanceof DTDSubset ) ) { return null ; } List < EntityDecl > l = ( ( DTDSubset ) mDTD ) . getGeneralEntityList ( ) ; /* Let ' s make a copy , so that caller can not modify
* DTD... |
public class CryptoFileSystemUri { /** * Constructs a CryptoFileSystem URI by using the given absolute path to a vault and constructing a path inside the vault from components .
* @ param pathToVault path to the vault
* @ param pathComponentsInsideVault path components to node inside the vault */
public static URI ... | try { return new URI ( URI_SCHEME , pathToVault . toUri ( ) . toString ( ) , "/" + String . join ( "/" , pathComponentsInsideVault ) , null , null ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Can not create URI from given input" , e ) ; } |
public class ContentInfoUtil { /** * Return the content type from the associated bytes or null if none of the magic entries matched . */
public ContentInfo findMatch ( byte [ ] bytes ) { } } | if ( bytes . length == 0 ) { return ContentInfo . EMPTY_INFO ; } else { return magicEntries . findMatch ( bytes ) ; } |
public class ZonedDateTime { /** * Obtains an instance of { @ code ZonedDateTime } from a local date and time .
* This creates a zoned date - time matching the input local date and time as closely as possible .
* Time - zone rules , such as daylight savings , mean that not every local date - time
* is valid for t... | return of ( LocalDateTime . of ( date , time ) , zone ) ; |
public class Attachment { /** * Get the input stream of the content ( aka ' body ' ) data .
* @ throws CouchbaseLiteException */
@ InterfaceAudience . Public public InputStream getContent ( ) throws CouchbaseLiteException { } } | if ( body != null ) { return body ; } else { return new ByteArrayInputStream ( internalAttachment ( ) . getContent ( ) ) ; } |
public class Streams { /** * Convert an Optional to a Stream
* < pre >
* { @ code
* Stream < Integer > stream = Streams . optionalToStream ( Optional . of ( 1 ) ) ;
* / / Stream [ 1]
* Stream < Integer > zero = Streams . optionalToStream ( Optional . zero ( ) ) ;
* / / Stream [ ]
* < / pre >
* @ param o... | if ( optional . isPresent ( ) ) return Stream . of ( optional . get ( ) ) ; return Stream . of ( ) ; |
public class SBPrintStream { /** * Convert a String [ ] into a valid Java String initializer */
public SBPrintStream toJavaStringInit ( String [ ] ss ) { } } | if ( ss == null ) { return p ( "null" ) ; } p ( '{' ) ; for ( int i = 0 ; i < ss . length - 1 ; i ++ ) { p ( '"' ) . pj ( ss [ i ] ) . p ( "\"," ) ; } if ( ss . length > 0 ) { p ( '"' ) . pj ( ss [ ss . length - 1 ] ) . p ( '"' ) ; } return p ( '}' ) ; |
public class RegionInstanceGroupManagerClient { /** * Creates a managed instance group using the information that you specify in the request . After
* the group is created , instances in the group are created using the specified instance template .
* This operation is marked as DONE when the group is created even i... | InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest . newBuilder ( ) . setRegion ( region ) . setInstanceGroupManagerResource ( instanceGroupManagerResource ) . build ( ) ; return insertRegionInstanceGroupManager ( request ) ; |
public class JideApplicationWindow { /** * Sets the active page by loading that page ' s components and
* applying the layout . Also updates the show view command menu
* to list the views within the page . */
protected void setActivePage ( ApplicationPage page ) { } } | getPage ( ) . getControl ( ) ; loadLayoutData ( page . getId ( ) ) ; ( ( JideApplicationPage ) getPage ( ) ) . updateShowViewCommands ( ) ; |
public class PageSourceImpl { /** * remove the last elemtn of a path
* @ param path path to remove last element from it
* @ param isOutSide
* @ return path with removed element */
private static String pathRemoveLast ( String path , RefBoolean isOutSide ) { } } | if ( path . length ( ) == 0 ) { isOutSide . setValue ( true ) ; return ".." ; } else if ( path . endsWith ( ".." ) ) { isOutSide . setValue ( true ) ; return path . concat ( "/.." ) ; // path + " / . . " ;
} return path . substring ( 0 , path . lastIndexOf ( '/' ) ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcRoofTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class DataSet { /** * Add rows of given data set to this data set .
* @ param other The other data set .
* @ return The data set instance ( for chained calls ) .
* @ throws InvalidOperationException
* if this data set is read - only , or
* if the data source of the other data set differs
* from this ... | checkIfNotReadOnly ( ) ; if ( other . getSource ( ) != source ) { throw new InvalidOperationException ( "Data source mismatch." ) ; } rows . addAll ( other . rows ) ; return this ; |
public class WMSService { /** * Convertes to a WMS URL
* @ param x the x coordinate
* @ param y the y coordinate
* @ param zoom the zomm factor
* @ param tileSize the tile size
* @ return a URL request string */
public String toWMSURL ( int x , int y , int zoom , int tileSize ) { } } | String format = "image/jpeg" ; String styles = "" ; String srs = "EPSG:4326" ; int ts = tileSize ; int circumference = widthOfWorldInPixels ( zoom , tileSize ) ; double radius = circumference / ( 2 * Math . PI ) ; double ulx = MercatorUtils . xToLong ( x * ts , radius ) ; double uly = MercatorUtils . yToLat ( y * ts , ... |
public class LoggerOddities { /** * implements the visitor to look for calls to Logger . getLogger with the wrong class name
* @ param seen
* the opcode of the currently parsed instruction */
@ Override @ SuppressWarnings ( "unchecked" ) public void sawOpcode ( int seen ) { } } | String ldcClassName = null ; String seenMethodName = null ; boolean seenToString = false ; boolean seenFormatterLogger = false ; int exMessageReg = - 1 ; Integer arraySize = null ; boolean simpleFormat = false ; try { stack . precomputation ( this ) ; if ( ( seen == Const . LDC ) || ( seen == Const . LDC_W ) ) { Consta... |
public class AmazonLightsailClient { /** * Returns the current , previous , or pending versions of the master user password for a Lightsail database .
* The < code > asdf < / code > operation GetRelationalDatabaseMasterUserPassword supports tag - based access control via
* resource tags applied to the resource iden... | request = beforeClientExecution ( request ) ; return executeGetRelationalDatabaseMasterUserPassword ( request ) ; |
public class UDPReadRequestContextImpl { /** * @ see
* com . ibm . websphere . udp . channel . UDPReadRequestContext # readAlways ( com . ibm .
* websphere . udp . channel . UDPReadCompletedCallbackThreaded , boolean ) */
public void readAlways ( UDPReadCompletedCallbackThreaded callback , boolean enable ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "readAlways(enable=" + enable + ")" ) ; } if ( enable ) { this . readAlwaysCallback = callback ; } else { this . readAlwaysCallback = null ; } getWorkQueueManager ( ) . processWork ( this ) ; if ( TraceComponent . isAnyTracin... |
public class Parameters { /** * Gets objects defined by namespaces . It frequently happens that a program needs to have
* specified some set of objects to use , where each object is defined by some namespace . For
* example , in the name finder , we might need to use a number of different name set groups , where
... | final Parameters subNamespace = copyNamespace ( baseNamespace ) ; final ImmutableSet . Builder < T > ret = ImmutableSet . builder ( ) ; for ( final String activeNamespace : subNamespace . getStringList ( activeNamespacesFeature ) ) { if ( subNamespace . isNamespacePresent ( activeNamespace ) ) { ret . add ( nameSpaceTo... |
public class IOUtils { /** * < p > getStackTrace . < / p >
* @ param ex a { @ link java . lang . Throwable } object .
* @ return a { @ link java . lang . String } object . */
public static String getStackTrace ( Throwable ex ) { } } | StringWriter buf = new StringWriter ( ) ; ex . printStackTrace ( new PrintWriter ( buf ) ) ; return buf . toString ( ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link OrderAck }
* { @ code > } .
* @ param value the value
* @ return the JAXB element < order ack > */
@ XmlElementDecl ( namespace = "urn:switchyard-quickstart:bpm-service:1.0" , name = "submitOrderResponse" ) publi... | return new JAXBElement < OrderAck > ( ORDER_ACK_QNAME , OrderAck . class , null , value ) ; |
public class Switch { /** * Color of the right hand side of the switch . Legal values : ' primary ' ,
* ' info ' , ' success ' , ' warning ' , ' danger ' , ' default ' . Default value :
* ' primary ' .
* @ return Returns the value of the attribute , or null , if it hasn ' t been
* set by the JSF file . */
publi... | String value = ( String ) getStateHelper ( ) . eval ( PropertyKeys . offColor ) ; return value ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.