signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Get { /** * Retrieves the provided css attribute of the element . If the element isn ' t
* present , the css attribute doesn ' t exist , or the attributes can ' t be
* accessed , a null value will be returned .
* @ param attribute - the css attribute to be returned
* @ return String : the value of ... | if ( ! element . is ( ) . present ( ) ) { return null ; } try { WebElement webElement = element . getWebElement ( ) ; return webElement . getCssValue ( attribute ) ; } catch ( NoSuchMethodError | Exception e ) { log . warn ( e ) ; return null ; } |
public class Generics { /** * Build class type variable name and type variable implementation lookup
* @ param theClass the class to build the lookup
* @ return the lookup */
public static Map < String , Class > buildTypeParamImplLookup ( Class theClass ) { } } | Map < String , Class > lookup = new HashMap < > ( ) ; buildTypeParamImplLookup ( theClass , lookup ) ; return lookup ; |
public class PublicanPODocBookBuilder { /** * Creates the actual PO / POT files for a specific file .
* @ param buildData
* @ param filePathAndName The
* @ param translations The mapping of original strings to translation strings , that will be used to build the po / pot files .
* @ throws BuildProcessingExcept... | // Don ' t create files where there is nothing to translate
if ( ! translations . isEmpty ( ) ) { final StringBuilder potFile = createBasePOFile ( buildData ) ; final StringBuilder poFile = createBasePOFile ( buildData ) ; for ( final Map . Entry < String , TranslationDetails > entry : translations . entrySet ( ) ) { f... |
public class EqualityMatcher { /** * Implement handlePut . */
void handlePut ( SimpleTest test , Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { } } | if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "handlePut" , new Object [ ] { test , selector , object , subExpr } ) ; Object value = test . getValue ( ) ; if ( value == null ) throw new IllegalStateException ( ) ; handleEqualityPut ( value , selector , object , subExpr ) ; if ( tc . isEntryEnabled ( ) ) t... |
import java . util . * ; public class TupleToStr { /** * Converts a list of tuples into a single string .
* Examples :
* > > > tuple _ to _ str ( [ ( ' 1 ' , ' 4 ' , ' 6 ' ) , ( ' 5 ' , ' 8 ' ) , ( ' 2 ' , ' 9 ' ) , ( ' 1 ' , ' 10 ' ) ] )
* ' 1 4 6 5 8 2 9 1 10'
* > > > tuple _ to _ str ( [ ( ' 2 ' , ' 3 ' , ' ... | String result = "" ; for ( List < String > tuple : tuplesList ) { for ( String element : tuple ) { result += element + " " ; } } return result . trim ( ) ; // Remove the last space |
public class DependentLocalityType { /** * Gets the value of the dependentLocalityName property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CO... | if ( dependentLocalityName == null ) { dependentLocalityName = new ArrayList < DependentLocalityType . DependentLocalityName > ( ) ; } return this . dependentLocalityName ; |
public class lbmonitor { /** * Use this API to add lbmonitor . */
public static base_response add ( nitro_service client , lbmonitor resource ) throws Exception { } } | lbmonitor addresource = new lbmonitor ( ) ; addresource . monitorname = resource . monitorname ; addresource . type = resource . type ; addresource . action = resource . action ; addresource . respcode = resource . respcode ; addresource . httprequest = resource . httprequest ; addresource . rtsprequest = resource . rt... |
public class AlpineResource { /** * Convenience method that returns true if the principal has the specified permission ,
* or false if not .
* @ param permission the permission to check
* @ return true if principal has permission assigned , false if not
* @ since 1.2.0 */
protected boolean hasPermission ( final... | if ( getPrincipal ( ) == null ) { return false ; } try ( AlpineQueryManager qm = new AlpineQueryManager ( ) ) { boolean hasPermission = false ; if ( getPrincipal ( ) instanceof ApiKey ) { hasPermission = qm . hasPermission ( ( ApiKey ) getPrincipal ( ) , permission ) ; } else if ( getPrincipal ( ) instanceof UserPrinci... |
public class OfflineChangePointDetectionAlgorithm { /** * Find the best position to assume a change in mean .
* @ param sums Cumulative sums
* @ param begin Interval begin
* @ param end Interval end
* @ return Best change position */
public static DoubleIntPair bestChangeInMean ( double [ ] sums , int begin , i... | final int len = end - begin , last = end - 1 ; final double suml = begin > 0 ? sums [ begin - 1 ] : 0. ; final double sumr = sums [ last ] ; int bestpos = begin ; double bestscore = Double . NEGATIVE_INFINITY ; // Iterate elements k = 2 . . n - 1 in math notation _
for ( int j = begin , km1 = 1 ; j < last ; j ++ , km1 ... |
public class RRuleIteratorImpl { /** * calculates and stored the next date in this recurrence . */
private void fetchNext ( ) { } } | if ( pendingUtc != null || done ) { return ; } DateValue dUtc = generateInstance ( ) ; // check the exit condition
if ( dUtc == null || ! condition . apply ( dUtc ) ) { done = true ; return ; } pendingUtc = dUtc ; yearGenerator . workDone ( ) ; |
public class DateFormatSymbols { /** * Loads localized names for day periods in the requested format .
* @ param resourceMap Contains the dayPeriod resource to load */
private String [ ] loadDayPeriodStrings ( Map < String , String > resourceMap ) { } } | String strings [ ] = new String [ DAY_PERIOD_KEYS . length ] ; if ( resourceMap != null ) { for ( int i = 0 ; i < DAY_PERIOD_KEYS . length ; ++ i ) { strings [ i ] = resourceMap . get ( DAY_PERIOD_KEYS [ i ] ) ; // Null if string doesn ' t exist .
} } return strings ; |
public class KickflipApiClient { /** * Login an exiting Kickflip User and make it active .
* @ param username The Kickflip user ' s username
* @ param password The Kickflip user ' s password
* @ param cb This callback will receive a User in { @ link io . kickflip . sdk . api . KickflipCallback # onSuccess ( io . ... | GenericData data = new GenericData ( ) ; data . put ( "username" , username ) ; data . put ( "password" , password ) ; post ( GET_USER_PRIVATE , new UrlEncodedContent ( data ) , User . class , new KickflipCallback ( ) { @ Override public void onSuccess ( final Response response ) { if ( VERBOSE ) Log . i ( TAG , "login... |
public class snmpengineid { /** * Use this API to unset the properties of snmpengineid resource .
* Properties that need to be unset are specified in args array . */
public static base_response unset ( nitro_service client , Long ownernode , String args [ ] ) throws Exception { } } | snmpengineid unsetresource = new snmpengineid ( ) ; unsetresource . ownernode = ownernode ; return unsetresource . unset_resource ( client , args ) ; |
public class QueueFile { /** * Reads the eldest element . Returns null if the queue is empty . */
public @ Nullable byte [ ] peek ( ) throws IOException { } } | if ( closed ) throw new IllegalStateException ( "closed" ) ; if ( isEmpty ( ) ) return null ; int length = first . length ; byte [ ] data = new byte [ length ] ; ringRead ( first . position + Element . HEADER_LENGTH , data , 0 , length ) ; return data ; |
public class ArchiveOutputSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ArchiveOutputSettings archiveOutputSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( archiveOutputSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( archiveOutputSettings . getContainerSettings ( ) , CONTAINERSETTINGS_BINDING ) ; protocolMarshaller . marshall ( archiveOutputSettings . getExtension ( ) , EXTENSI... |
public class DataSet { /** * Selects an element with maximum value .
* < p > The maximum is computed over the specified fields in lexicographical order .
* < p > < strong > Example 1 < / strong > : Given a data set with elements < code > [ 0 , 1 ] , [ 1 , 0 ] < / code > , the
* results will be :
* < ul >
* < ... | "unchecked" , "rawtypes" } ) public ReduceOperator < T > maxBy ( int ... fields ) { if ( ! getType ( ) . isTupleType ( ) ) { throw new InvalidProgramException ( "DataSet#maxBy(int...) only works on Tuple types." ) ; } return new ReduceOperator < > ( this , new SelectByMaxFunction ( ( TupleTypeInfo ) getType ( ) , field... |
public class Matchers { /** * Returns a Matcher that matches against nodes that are declared { @ code @ private } . */
public static Matcher isPrivate ( ) { } } | return new Matcher ( ) { @ Override public boolean matches ( Node node , NodeMetadata metadata ) { JSDocInfo jsDoc = NodeUtil . getBestJSDocInfo ( node ) ; if ( jsDoc != null ) { return jsDoc . getVisibility ( ) == Visibility . PRIVATE ; } return false ; } } ; |
public class SubDomainMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SubDomain subDomain , ProtocolMarshaller protocolMarshaller ) { } } | if ( subDomain == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( subDomain . getSubDomainSetting ( ) , SUBDOMAINSETTING_BINDING ) ; protocolMarshaller . marshall ( subDomain . getVerified ( ) , VERIFIED_BINDING ) ; protocolMarshaller . mars... |
public class StringUtils { /** * Convert first character in given string to upper case . < br >
* If given source string is blank or first character is upper case , return
* it ' s self .
* @ param source string to be tested .
* @ return a new string has been converted or it ' s self . */
public static String f... | if ( isBlank ( source ) || Character . isUpperCase ( source . charAt ( 0 ) ) ) { return source ; } StringBuilder destination = getStringBuild ( ) ; destination . append ( source . substring ( 0 , 1 ) . toUpperCase ( ) ) ; destination . append ( source . substring ( 1 ) ) ; return destination . toString ( ) ; |
public class DistributedTableSerializer { /** * Loads the table data from the path and writes it to the output stream . Returns the set of UUIDs associated with
* the table , just like { @ link # loadAndSerialize ( long , java . io . OutputStream ) } . */
private Set < Long > loadFromNode ( String path , OutputStream... | try { // Get the cached representation of this table
byte [ ] data = _curator . getData ( ) . forPath ( path ) ; DataInputStream in = new DataInputStream ( new ByteArrayInputStream ( data ) ) ; int uuidCountOrExceptionCode = in . readInt ( ) ; // A negative first integer indicates an exception condition .
if ( uuidCoun... |
public class PersistenceValidator { /** * Checks constraints present on embeddable attributes
* @ param embeddedObject
* @ param embeddedColumn
* @ param embeddedFieldName */
private void onValidateEmbeddable ( Object embeddedObject , EmbeddableType embeddedColumn ) { } } | if ( embeddedObject instanceof Collection ) { for ( Object obj : ( Collection ) embeddedObject ) { for ( Object column : embeddedColumn . getAttributes ( ) ) { Attribute columnAttribute = ( Attribute ) column ; Field f = ( Field ) columnAttribute . getJavaMember ( ) ; this . factory . validate ( f , embeddedObject , ne... |
public class RTMPConnection { /** * { @ inheritDoc } */
@ Override public void close ( ) { } } | if ( closing . compareAndSet ( false , true ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "close: {}" , sessionId ) ; } stopWaitForHandshake ( ) ; stopRoundTripMeasurement ( ) ; // update our state
if ( state != null ) { final byte s = getStateCode ( ) ; switch ( s ) { case RTMP . STATE_DISCONNECTED : if ( log ... |
public class IntegralImageOps { /** * Computes the value of a block inside an integral image and treats pixels outside of the
* image as zero . The block is defined as follows : x0 & lt ; x & le ; x1 and y0 & lt ; y & le ; y1.
* @ param integral Integral image .
* @ param x0 Lower bound of the block . Exclusive .... | return ImplIntegralImageOps . block_zero ( integral , x0 , y0 , x1 , y1 ) ; |
public class GuiBootstrap { /** * Tells whether or not ZAP is being started for first time . It does so by checking if the license was not yet been
* accepted .
* @ return { @ code true } if it ' s the first time , { @ code false } otherwise .
* @ see Constant # ACCEPTED _ LICENSE */
private static boolean isFirs... | Path acceptedLicenseFile = Paths . get ( Constant . getInstance ( ) . ACCEPTED_LICENSE ) ; return Files . notExists ( acceptedLicenseFile ) ; |
public class VdmPluginImages { /** * Creates an image descriptor for the given prefix and name in the JDT UI bundle . The path can contain variables
* like $ NL $ . If no image could be found , < code > useMissingImageDescriptor < / code > decides if either the ' missing
* image descriptor ' is returned or < code >... | IPath path = ICONS_PATH . append ( prefix ) . append ( name ) ; return createImageDescriptor ( VdmUIPlugin . getDefault ( ) . getBundle ( ) , path , useMissingImageDescriptor ) ; |
public class DataListRenderer { /** * Renders items with no strict markup
* @ param context FacesContext instance
* @ param list DataList component
* @ throws IOException */
protected void encodeStrictList ( FacesContext context , DataList list ) throws IOException { } } | ResponseWriter writer = context . getResponseWriter ( ) ; String clientId = list . getClientId ( context ) ; boolean isDefinition = list . isDefinition ( ) ; UIComponent definitionFacet = list . getFacet ( "description" ) ; boolean renderDefinition = isDefinition && definitionFacet != null ; String itemType = list . ge... |
public class Main { /** * Print a usage message . */
private static void badUsage ( String s ) { } } | System . err . println ( ToolErrorReporter . getMessage ( "msg.jsc.bad.usage" , Main . class . getName ( ) , s ) ) ; |
public class FakedWebserver { /** * faked http request handling . shows usage of OneAgent SDK ' s incoming webrequest API */
private void serve ( HttpRequest request , HttpResponse response ) { } } | String url = request . getUri ( ) ; System . out . println ( "[Server] serve " + url ) ; IncomingWebRequestTracer incomingWebrequestTracer = oneAgentSDK . traceIncomingWebRequest ( webAppInfo , url , request . getMethod ( ) ) ; // add request header , parameter and remote address before start :
for ( Entry < String , L... |
public class FontUtils { /** * Draw text right justified
* @ param font The font to draw with
* @ param s The string to draw
* @ param x The x location to draw at
* @ param y The y location to draw at
* @ param width The width to fill with the text */
public static void drawRight ( Font font , String s , int ... | drawString ( font , s , Alignment . RIGHT , x , y , width , Color . white ) ; |
public class GroupApi { /** * Creates a new project group . Available only for users who can create groups .
* < pre > < code > GitLab Endpoint : POST / groups < / code > < / pre >
* @ param name the name of the group to add
* @ param path the path for the group
* @ param description ( optional ) - The group ' ... | Form formData = new GitLabApiForm ( ) . withParam ( "name" , name ) . withParam ( "path" , path ) . withParam ( "description" , description ) . withParam ( "visibility" , visibility ) . withParam ( "lfs_enabled" , lfsEnabled ) . withParam ( "request_access_enabled" , requestAccessEnabled ) . withParam ( "parent_id" , i... |
public class MsgSettingController { /** * Download api json .
* @ param req the req
* @ param method the method
* @ param url the url
* @ param res the res */
@ GetMapping ( "/setting/download/api/json" ) public void downloadApiJson ( HttpServletRequest req , @ RequestParam ( "method" ) String method , @ Reques... | this . validationSessionComponent . sessionCheck ( req ) ; url = new String ( Base64 . getDecoder ( ) . decode ( url ) ) ; List < ValidationData > list = this . msgSettingService . getValidationData ( method , url ) ; ValidationFileUtil . sendFileToHttpServiceResponse ( method + url . replaceAll ( "/" , "-" ) + ".json"... |
public class MSExcelParser { /** * Sanitize headers
* 1 ) Replace empty / null column names by " Col " + column number
* 2 ) Replace duplicate column names by column name + increasing number
* 3 ) Replace column names based on regular expressions with another string ( useful in case your Big Data platform does no... | String result [ ] = new String [ headers . length ] ; HashMap < String , Integer > headerHashMap = new HashMap < > ( ) ; // for detecting duplicates
for ( int i = 0 ; i < headers . length ; i ++ ) { String currentColumn = headers [ i ] ; // if column name is empty create artificial column name
if ( ( currentColumn == n... |
public class Route53AutoNamingClient { /** * Gets a list of instances registered with Route53 given a service ID .
* @ param serviceId The service id
* @ return list of serviceInstances usable by MN . */
@ Override public Publisher < List < ServiceInstance > > getInstances ( String serviceId ) { } } | if ( serviceId == null ) { serviceId = getRoute53ClientDiscoveryConfiguration ( ) . getAwsServiceId ( ) ; // we can default to the config file
} ListInstancesRequest instancesRequest = new ListInstancesRequest ( ) . withServiceId ( serviceId ) ; Future < ListInstancesResult > instanceResult = getDiscoveryClient ( ) . l... |
public class Date { /** * Sets the month of this date to the specified value . This
* < tt > Date < / tt > object is modified so that it represents a point
* in time within the specified month , with the year , date , hour ,
* minute , and second the same as before , as interpreted in the
* local time zone . If... | int y = 0 ; if ( month >= 12 ) { y = month / 12 ; month %= 12 ; } else if ( month < 0 ) { y = CalendarUtils . floorDivide ( month , 12 ) ; month = CalendarUtils . mod ( month , 12 ) ; } BaseCalendar . Date d = getCalendarDate ( ) ; if ( y != 0 ) { d . setNormalizedYear ( d . getNormalizedYear ( ) + y ) ; } d . setMonth... |
public class CollectionConverter { /** * Converts an object to a collection
* @ param collectionType the collection type
* @ return the conversion function */
public static Function < Object , Collection < ? > > COLLECTION ( final Class < ? extends Collection > collectionType ) { } } | return as ( new CollectionConverterImpl < > ( collectionType , null ) ) ; |
public class Tuple { /** * Create new Sextuple ( Tuple with six elements ) .
* @ param < T1 >
* @ param < T2 >
* @ param < T3 >
* @ param < T4 >
* @ param < T5 >
* @ param < T6 >
* @ param e1
* @ param e2
* @ param e3
* @ param e4
* @ param e5
* @ param e6
* @ return Sextuple */
public static ... | return new Sextuple < T1 , T2 , T3 , T4 , T5 , T6 > ( e1 , e2 , e3 , e4 , e5 , e6 ) ; |
public class JMElasticsearchBulk { /** * Delete bulk docs bulk response .
* @ param index the index
* @ param type the type
* @ param filterQueryBuilder the filter query builder
* @ return the bulk response */
public BulkResponse deleteBulkDocs ( String index , String type , QueryBuilder filterQueryBuilder ) { ... | return executeBulkRequest ( buildDeleteBulkRequestBuilder ( buildExtractDeleteRequestBuilderList ( index , type , filterQueryBuilder ) ) ) ; |
public class MappingUtils { /** * Returns class static field value
* Is used to return Constants
* @ param clazz Class static field of which would be returned
* @ param fieldName field name
* @ return field value
* @ throws org . midao . jdbc . core . exception . MjdbcException if field is not present or acce... | Object result = null ; Field field = null ; try { field = clazz . getField ( fieldName ) ; result = field . get ( null ) ; } catch ( NoSuchFieldException ex ) { throw new MjdbcException ( ex ) ; } catch ( IllegalAccessException ex ) { throw new MjdbcException ( ex ) ; } return result ; |
public class SpELFunction { /** * 使用spel表达式获取表达式对象 , 使用表达式缓存
* @ param spel
* 表达式
* @ return 表达式对象 */
private synchronized Expression getExpression ( String spel ) { } } | Expression expression = expressionCache . get ( spel ) ; if ( expression == null ) { expression = parser . parseExpression ( spel ) ; expressionCache . put ( spel , expression ) ; } return expression ; |
public class ArrayUtils { /** * This method does a similar job to JSE 6.0 ' s Arrays . copyOf ( ) method and overloads the method for use with arrays of char
* @ param charArray The array to copy
* @ return A copy of the input , of component type U */
public static char [ ] copyOf ( char [ ] charArray ) { } } | char [ ] copy = new char [ charArray . length ] ; System . arraycopy ( charArray , 0 , copy , 0 , charArray . length ) ; return copy ; |
public class _ArrayMap { /** * Gets the object stored with the given key . Scans first
* by object identity , then by object equality . */
static public Object get ( Object [ ] array , Object key ) { } } | Object o = getByIdentity ( array , key ) ; if ( o != null ) { return o ; } return getByEquality ( array , key ) ; |
public class ModelControllerImpl { /** * Await service container stability .
* @ param timeout maximum period to wait for service container stability
* @ param timeUnit unit in which { @ code timeout } is expressed
* @ param interruptibly { @ code true } if thread interruption should be ignored
* @ throws java ... | if ( interruptibly ) { stateMonitor . awaitStability ( timeout , timeUnit ) ; } else { stateMonitor . awaitStabilityUninterruptibly ( timeout , timeUnit ) ; } |
public class AuroraHeronShellController { /** * Restart an aurora container */
@ Override public boolean restart ( Integer containerId ) { } } | // there is no backpressure for container 0 , delegate to aurora client
if ( containerId == null || containerId == 0 ) { return cliController . restart ( containerId ) ; } if ( stateMgrAdaptor == null ) { LOG . warning ( "SchedulerStateManagerAdaptor not initialized" ) ; return false ; } StMgr sm = searchContainer ( co... |
public class IconicsAnimatedDrawable { /** * Attach an { @ link IconicsAnimationProcessor processor } to this drawable */
@ NonNull public IconicsAnimatedDrawable processor ( @ NonNull IconicsAnimationProcessor processor ) { } } | if ( processor == null ) return this ; processor . setDrawable ( this ) ; mProcessors . add ( processor ) ; return this ; |
public class SimpleRpcDispatcher { /** * Find out which field in the incoming message contains the payload that is .
* delivered to the service method . */
protected FieldDescriptor resolvePayloadField ( Message message ) { } } | for ( FieldDescriptor field : message . getDescriptorForType ( ) . getFields ( ) ) { if ( message . hasField ( field ) ) { return field ; } } throw new RuntimeException ( "No payload found in message " + message ) ; |
public class WebDavServiceImpl { /** * Gives the name of the repository to access .
* @ param repoName the name of the expected repository .
* @ return the name of the repository to access . */
protected String getRepositoryName ( String repoName ) throws RepositoryException { } } | // To be cloud compliant we need now to ignore the provided repository name ( more details in JCR - 2138)
ManageableRepository repo = repositoryService . getCurrentRepository ( ) ; String currentRepositoryName = repo . getConfiguration ( ) . getName ( ) ; if ( PropertyManager . isDevelopping ( ) && log . isWarnEnabled ... |
public class CacheEventDispatcherImpl { /** * Synchronized to make sure listener removal is atomic
* @ param wrapper the listener wrapper to unregister
* @ param listenersList the listener list to remove from */
private synchronized boolean removeWrapperFromList ( EventListenerWrapper < K , V > wrapper , List < Eve... | int index = listenersList . indexOf ( wrapper ) ; if ( index != - 1 ) { EventListenerWrapper < K , V > containedWrapper = listenersList . remove ( index ) ; if ( containedWrapper . isOrdered ( ) && -- orderedListenerCount == 0 ) { storeEventSource . setEventOrdering ( false ) ; } if ( -- listenersCount == 0 ) { storeEv... |
public class KunderaQuery { /** * Inits the filter . */
private void initFilter ( ) { } } | EntityMetadata metadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClass ) ; Metamodel metaModel = kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( entityClass ) ; if ( null == filter ) { List < String > cla... |
public class Iterators { /** * Wraps another iterator and throws away nulls . */
public static < T > Iterator < T > removeNull ( final Iterator < T > itr ) { } } | return com . google . common . collect . Iterators . filter ( itr , Predicates . notNull ( ) ) ; |
public class MatrixFunctions { /** * Applies the < i > cosine < / i > function element - wise on this
* matrix . Note that this is an in - place operation .
* @ see MatrixFunctions # cos ( DoubleMatrix )
* @ return this matrix */
public static DoubleMatrix cosi ( DoubleMatrix x ) { } } | /* # mapfct ( ' Math . cos ' ) # */
// RJPP - BEGIN - - - - -
for ( int i = 0 ; i < x . length ; i ++ ) x . put ( i , ( double ) Math . cos ( x . get ( i ) ) ) ; return x ; // RJPP - END - - - - - |
public class TransformerIdentityImpl { /** * Set an output property that will be in effect for the
* transformation .
* < p > Pass a qualified property name as a two - part string , the namespace URI
* enclosed in curly braces ( { } ) , followed by the local name . If the
* name has a null URL , the String only... | if ( ! OutputProperties . isLegalPropertyKey ( name ) ) throw new IllegalArgumentException ( XSLMessages . createMessage ( XSLTErrorResources . ER_OUTPUT_PROPERTY_NOT_RECOGNIZED , new Object [ ] { name } ) ) ; // " output property not recognized : "
// + name ) ;
m_outputFormat . setProperty ( name , value ) ; |
public class Options { /** * Returns whether the named { @ link Option } is a member of this { @ link Options } .
* @ param opt long name of the { @ link Option }
* @ return true if the named { @ link Option } is a member of this { @ link Options }
* @ since 1.3 */
public boolean hasLongOption ( String opt ) { } ... | opt = Util . stripLeadingHyphens ( opt ) ; return longOpts . containsKey ( opt ) ; |
public class TaskConfig { /** * Sets the default convergence criterion of a { @ link DeltaIteration }
* @ param aggregatorName
* @ param convCriterion */
public void setImplicitConvergenceCriterion ( String aggregatorName , ConvergenceCriterion < ? > convCriterion ) { } } | try { InstantiationUtil . writeObjectToConfig ( convCriterion , this . config , ITERATION_IMPLICIT_CONVERGENCE_CRITERION ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error while writing the implicit convergence criterion object to the task configuration." ) ; } this . config . setString ( ITERATION_IMP... |
public class AABBUtils { /** * Gets an empty { @ link AxisAlignedBB } ( size 0x0x0 ) at the { @ link BlockPos } position .
* @ param pos the pos
* @ return the axis aligned bb */
public static AxisAlignedBB empty ( BlockPos pos ) { } } | return new AxisAlignedBB ( pos . getX ( ) , pos . getY ( ) , pos . getZ ( ) , pos . getX ( ) , pos . getY ( ) , pos . getZ ( ) ) ; |
public class CalendarModifiedFollowingHandler { public Calendar adjustDate ( final Calendar startDate , final int increment , final NonWorkingDayChecker < Calendar > checker ) { } } | final Calendar cal = ( Calendar ) startDate . clone ( ) ; int step = increment ; final int month = cal . get ( Calendar . MONTH ) ; while ( checker . isNonWorkingDay ( cal ) ) { cal . add ( Calendar . DAY_OF_MONTH , step ) ; if ( month != cal . get ( Calendar . MONTH ) ) { // switch direction and go back
step *= - 1 ; ... |
public class DatabaseProvider { /** * Builder method to create and initialize an instance of this class using
* the JDBC standard DriverManager method . The url parameter will be inspected
* to determine the Flavor for this database . */
@ CheckReturnValue public static Builder fromDriverManager ( String url , Prop... | return fromDriverManager ( url , Flavor . fromJdbcUrl ( url ) , info , null , null ) ; |
public class BellaDati { /** * Reflectively loads the implementation ' s constructor to open a
* { @ link BellaDatiConnection } .
* @ return the constructor of a { @ link BellaDatiConnection } implementation
* @ throws ClassNotFoundException if the implementing class isn ' t found
* @ throws NoSuchMethodExcepti... | Class < ? > clazz = Class . forName ( "com.belladati.sdk.impl.BellaDatiConnectionImpl" ) ; Constructor < ? > constructor = clazz . getDeclaredConstructor ( String . class , Boolean . TYPE ) ; constructor . setAccessible ( true ) ; return constructor ; |
public class LocalLearnerProcessor { /** * On event .
* @ param event the event
* @ return true , if successful */
@ Override public boolean process ( ContentEvent event ) { } } | InstanceContentEvent inEvent = ( InstanceContentEvent ) event ; Instance instance = inEvent . getInstance ( ) ; if ( inEvent . getInstanceIndex ( ) < 0 ) { // end learning
ResultContentEvent outContentEvent = new ResultContentEvent ( - 1 , instance , 0 , new double [ 0 ] , inEvent . isLastEvent ( ) ) ; outContentEvent ... |
public class GlobusGSSContextImpl { /** * Retrieves arbitrary data about this context .
* Currently supported oid : < UL >
* < LI >
* { @ link GSSConstants # X509 _ CERT _ CHAIN GSSConstants . X509 _ CERT _ CHAIN }
* returns certificate chain of the peer ( < code > X509Certificate [ ] < / code > ) .
* < / LI ... | if ( oid == null ) { throw new GlobusGSSException ( GSSException . FAILURE , GlobusGSSException . BAD_ARGUMENT , "nullOption" ) ; } if ( oid . equals ( GSSConstants . X509_CERT_CHAIN ) ) { if ( isEstablished ( ) ) { // converting certs is slower but keeping coverted certs
// takes lots of memory .
try { /* DEL
Vector... |
public class DefaultAnnotationProvider { /** * < p > Return a list of classes to examine from the specified JAR archive .
* If this archive has no classes in it , a zero - length list is returned . < / p >
* @ param context < code > ExternalContext < / code > instance for
* this application
* @ param jar < code... | // Accumulate and return a list of classes in this JAR file
ClassLoader loader = ClassUtils . getContextClassLoader ( ) ; if ( loader == null ) { loader = this . getClass ( ) . getClassLoader ( ) ; } Enumeration < JarEntry > entries = jar . entries ( ) ; while ( entries . hasMoreElements ( ) ) { JarEntry entry = entrie... |
public class XSLTElementDef { /** * Given a namespace URI , and a local name , get the processor
* for the element , or return null if not allowed .
* @ param uri The Namespace URI , or an empty string .
* @ param localName The local name ( without prefix ) , or empty string if not namespace processing .
* @ re... | XSLTElementProcessor elemDef = null ; // return value
if ( null == m_elements ) return null ; int n = m_elements . length ; int order = - 1 ; boolean multiAllowed = true ; for ( int i = 0 ; i < n ; i ++ ) { XSLTElementDef def = m_elements [ i ] ; // A " * " signals that the element allows literal result
// elements , s... |
public class LicenseHandler { /** * Approve or reject a license
* @ param name String
* @ param approved Boolean */
public void approveLicense ( final String name , final Boolean approved ) { } } | final DbLicense license = getLicense ( name ) ; repoHandler . approveLicense ( license , approved ) ; |
public class NeuralNetworkParser { /** * 获取距离特征
* @ param ctx 当前特征
* @ param features 输出特征 */
void get_distance_features ( final Context ctx , List < Integer > features ) { } } | if ( ! use_distance ) { return ; } int dist = 8 ; if ( ctx . S0 >= 0 && ctx . S1 >= 0 ) { dist = math . binned_1_2_3_4_5_6_10 [ ctx . S0 - ctx . S1 ] ; if ( dist == 10 ) { dist = 7 ; } } features . add ( dist + kDistanceInFeaturespace ) ; |
public class RegionOperationId { /** * Returns a region operation identity given project , region and operation names . */
public static RegionOperationId of ( String project , String region , String operation ) { } } | return new RegionOperationId ( project , region , operation ) ; |
public class Apptentive { /** * Our SDK must connect to our server at least once to download initial configuration for Message
* Center . Call this method to see whether or not Message Center can be displayed . This task is
* performed asynchronously .
* @ param callback Called after we check to see if Message Ce... | dispatchConversationTask ( new ConversationDispatchTask ( callback , DispatchQueue . mainQueue ( ) ) { @ Override protected boolean execute ( Conversation conversation ) { return ApptentiveInternal . canShowMessageCenterInternal ( conversation ) ; } } , "check message center availability" ) ; |
public class Humanize { /** * Same as { @ link # paceFormat ( Number , long , String , String , String ) } for a
* target locale .
* @ param locale
* The target locale
* @ param value
* The number of occurrences within the specified interval
* @ param params
* The pace format parameterezation
* @ return... | return withinLocale ( new Callable < String > ( ) { @ Override public String call ( ) throws Exception { return paceFormat ( value , params ) ; } } , locale ) ; |
public class UnixPath { /** * Returns last component in { @ code path } .
* @ see java . nio . file . Path # getFileName ( ) */
@ Nullable public UnixPath getFileName ( ) { } } | if ( path . isEmpty ( ) ) { return EMPTY_PATH ; } else if ( isRoot ( ) ) { return null ; } else { List < String > parts = getParts ( ) ; String last = parts . get ( parts . size ( ) - 1 ) ; return parts . size ( ) == 1 && path . equals ( last ) ? this : new UnixPath ( permitEmptyComponents , last ) ; } |
public class BigtableClientMetrics { /** * Creates a named { @ link Timer } . This is a shortcut for
* { @ link BigtableClientMetrics # getMetricRegistry ( MetricLevel ) } .
* { @ link MetricRegistry # timer ( String ) } .
* @ return a { @ link Timer } */
public static Timer timer ( MetricLevel level , String nam... | return getMetricRegistry ( level ) . timer ( METRIC_PREFIX + name ) ; |
public class RuleSetExecutor { /** * Applies the given concept .
* @ param concept
* The concept .
* @ throws RuleException
* If the concept cannot be applied . */
private boolean applyConcept ( RuleSet ruleSet , Concept concept , Severity severity ) throws RuleException { } } | Boolean result = executedConcepts . get ( concept ) ; if ( result == null ) { if ( applyRequiredConcepts ( ruleSet , concept ) ) { result = ruleVisitor . visitConcept ( concept , severity ) ; } else { ruleVisitor . skipConcept ( concept , severity ) ; result = false ; } executedConcepts . put ( concept , result ) ; } r... |
public class DestinationNamePattern { /** * Match a string against the pattern represented by this object . */
public boolean match ( String destinationName ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "match" , destinationName ) ; boolean matches = false ; if ( ! patternIsWildcarded ) { // Match the name directly through String equality
matches = destinationName . equals ( destinationNamePatternString ) ; } else { // We n... |
public class CommerceOrderNotePersistenceImpl { /** * Caches the commerce order note in the entity cache if it is enabled .
* @ param commerceOrderNote the commerce order note */
@ Override public void cacheResult ( CommerceOrderNote commerceOrderNote ) { } } | entityCache . putResult ( CommerceOrderNoteModelImpl . ENTITY_CACHE_ENABLED , CommerceOrderNoteImpl . class , commerceOrderNote . getPrimaryKey ( ) , commerceOrderNote ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_C_ERC , new Object [ ] { commerceOrderNote . getCompanyId ( ) , commerceOrderNote . getExternalRefere... |
public class CompareStringQuery { /** * Construct a { @ link Query } implementation that scores documents with a string field value that is greater than or equal to
* the supplied constraint value .
* @ param constraintValue the constraint value ; may not be null
* @ param fieldName the name of the document field... | return FieldComparison . GE . createQueryForNodesWithField ( constraintValue , fieldName , caseOperation ) ; |
public class BandwidthClient { /** * This method implements an HTTP delete . Use this method to remove a resource .
* @ param uri the URI .
* @ return the response .
* @ throws IOException unexpected exception .
* @ throws AppPlatformException unexpected exception . */
public RestResponse delete ( final String ... | return request ( getPath ( uri ) , HttpDelete . METHOD_NAME ) ; |
public class XtraBox { /** * Removes specified tag ( all values for that tag will be removed )
* @ param name Tag to remove */
public void removeTag ( String name ) { } } | XtraTag tag = getTagByName ( name ) ; if ( tag != null ) { tags . remove ( tag ) ; } |
public class ReplicationLinksInner { /** * Sets which replica database is primary by failing over from the current primary replica database . This operation might result in data loss .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Reso... | return beginFailoverAllowDataLossWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , linkId ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class TriggersInner { /** * Lists all the triggers configured in the device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ param expand Specify $ filter = ' CustomContextTag eq & lt ; tag & gt ; ' to filter on custom context tag property
* @ throws Ille... | return listByDataBoxEdgeDeviceSinglePageAsync ( deviceName , resourceGroupName , expand ) . concatMap ( new Func1 < ServiceResponse < Page < TriggerInner > > , Observable < ServiceResponse < Page < TriggerInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < TriggerInner > > > call ( ServiceRespon... |
public class AbstractJaxRsConformanceProvider { /** * This method will set the conformance during the postconstruct phase . The method { @ link AbstractJaxRsConformanceProvider # getProviders ( ) } is used to get all the resource providers include in the
* conformance */
@ PostConstruct protected synchronized void se... | if ( myInitialized ) { return ; } for ( Entry < Class < ? extends IResourceProvider > , IResourceProvider > provider : getProviders ( ) . entrySet ( ) ) { addProvider ( provider . getValue ( ) , provider . getKey ( ) ) ; } List < BaseMethodBinding < ? > > serverBindings = new ArrayList < BaseMethodBinding < ? > > ( ) ;... |
public class BELScriptLexer { /** * $ ANTLR start " OBJECT _ IDENT " */
public final void mOBJECT_IDENT ( ) throws RecognitionException { } } | try { int _type = OBJECT_IDENT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // BELScript . g : 277:13 : ( ( ' _ ' | LETTER | DIGIT ) + )
// BELScript . g : 278:5 : ( ' _ ' | LETTER | DIGIT ) +
{ // BELScript . g : 278:5 : ( ' _ ' | LETTER | DIGIT ) +
int cnt7 = 0 ; loop7 : do { int alt7 = 2 ; int LA7_0 = input . LA ( 1 ) ;... |
public class OpenSslSessionStats { /** * Returns the number of successfully reused sessions . In client mode , a session set with { @ code SSL _ set _ session }
* successfully reused is counted as a hit . In server mode , a session successfully retrieved from internal or
* external cache is counted as a hit . */
pu... | Lock readerLock = context . ctxLock . readLock ( ) ; readerLock . lock ( ) ; try { return SSLContext . sessionHits ( context . ctx ) ; } finally { readerLock . unlock ( ) ; } |
public class PluralCodeGenerator { /** * Generate a class for plural rule evaluation .
* This will build several Condition fields which evaluate specific AND conditions ,
* and methods which call these AND conditions joined by an OR operator . */
public void generate ( Path outputDir , DataReader reader ) throws IO... | String className = "_PluralRules" ; TypeSpec . Builder type = TypeSpec . classBuilder ( className ) . addModifiers ( PUBLIC ) . superclass ( TYPE_BASE ) ; Map < String , FieldSpec > fieldMap = buildConditionFields ( reader . cardinals ( ) , reader . ordinals ( ) ) ; for ( Map . Entry < String , FieldSpec > entry : fiel... |
public class LambdaMap { /** * Wrap a { @ link Map } in a { @ link LambdaMap } .
* @ param map the { @ link Map }
* @ param < A > the key type
* @ param < B > the value type
* @ return the { @ link Map } wrapped in a { @ link LambdaMap } */
public static < A , B > LambdaMap < A , B > wrap ( Map < A , B > map ) ... | return new LambdaMap < > ( map ) ; |
public class ResourceRecordSets { /** * creates sshfp set of { @ link denominator . model . rdata . SSHFPData SSHFP } records for the specified
* name and ttl .
* @ param name ex . { @ code denominator . io . }
* @ param sshfpdata sshfpdata values ex . { @ code 1 1 B33F } */
public static ResourceRecordSet < SSHF... | return new SSHFPBuilder ( ) . name ( name ) . add ( sshfpdata ) . build ( ) ; |
public class AerospikeLog4jAppender { /** * ( non - Javadoc )
* @ see org . apache . log4j . AppenderSkeleton # append ( org . apache . log4j . spi . LoggingEvent ) */
@ Override @ SuppressWarnings ( { } } | "unchecked" } ) protected void append ( final LoggingEvent event ) { if ( null == this . client ) { try { connectToAerospike ( ) ; } catch ( UnknownHostException e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } } List < Bin > binList = new ArrayList < Bin > ( ) ; StringBuilder keyString = new StringBuild... |
public class FileNode { /** * does not include the drive on windows */
@ Override public String getPath ( ) { } } | String result ; result = path . toString ( ) . substring ( getRoot ( ) . getAbsolute ( ) . length ( ) ) ; return result . replace ( File . separatorChar , Filesystem . SEPARATOR_CHAR ) ; |
public class CloseInventoryMessage { /** * Sends a packet to client to notify it to open a { @ link MalisisInventory } .
* @ param player the player */
public static void send ( EntityPlayerMP player ) { } } | Packet packet = new Packet ( ) ; MalisisCore . network . sendTo ( packet , player ) ; |
public class DateTimeFormatter { /** * Parses the text using this formatter , providing control over the text position .
* This parses the text without requiring the parse to start from the beginning
* of the string or finish at the end .
* The result of this method is { @ code TemporalAccessor } which has been r... | Jdk8Methods . requireNonNull ( text , "text" ) ; Jdk8Methods . requireNonNull ( position , "position" ) ; try { return parseToBuilder ( text , position ) . resolve ( resolverStyle , resolverFields ) ; } catch ( DateTimeParseException ex ) { throw ex ; } catch ( IndexOutOfBoundsException ex ) { throw ex ; } catch ( Runt... |
public class LinkedPredict { /** * 确保结果个数小于等于n
* @ param n */
public void assertSize ( int n ) { } } | while ( labels . size ( ) > n ) { labels . removeLast ( ) ; scores . removeLast ( ) ; if ( evidences . size ( ) > n ) evidences . removeLast ( ) ; } |
public class AtomicDouble { /** * Set the value to { @ code amount } and return the previous value . */
public double getAndSet ( double amount ) { } } | long v = value . getAndSet ( Double . doubleToLongBits ( amount ) ) ; return Double . longBitsToDouble ( v ) ; |
public class FlowController { /** * Internal destroy method that is invoked when this object is being removed from the session . This is a
* framework - invoked method ; it should not normally be called directly . */
void destroy ( HttpSession session ) { } } | onDestroy ( ) ; // for backwards compatiblity
super . destroy ( session ) ; // We may have lost our transient ServletContext reference . Try to get the ServletContext reference from the
// HttpSession object if necessary .
ServletContext servletContext = getServletContext ( ) ; if ( servletContext == null && session !=... |
public class AmazonEC2Client { /** * Moves an Elastic IP address from the EC2 - Classic platform to the EC2 - VPC platform . The Elastic IP address must be
* allocated to your account for more than 24 hours , and it must not be associated with an instance . After the
* Elastic IP address is moved , it is no longer ... | request = beforeClientExecution ( request ) ; return executeMoveAddressToVpc ( request ) ; |
public class ThreadContextClassLoaderBuilder { /** * Adds the supplied anURL to the list of internal URLs which should be used to build an URLClassLoader .
* Will only add an URL once , and warns about trying to re - add an URL .
* @ param anURL The URL to add .
* @ return This ThreadContextClassLoaderBuilder , f... | // Check sanity
Validate . notNull ( anURL , "anURL" ) ; // Add the segment unless already added .
for ( URL current : urlList ) { if ( current . toString ( ) . equalsIgnoreCase ( anURL . toString ( ) ) ) { if ( log . isWarnEnabled ( ) ) { log . warn ( "Not adding URL [" + anURL . toString ( ) + "] twice. Check your pl... |
public class OperationSupport { /** * Replace a resource , optionally performing placeholder substitution to the response .
* @ param updated updated object
* @ param type type of object provided
* @ param parameters a HashMap containing parameters for processing object
* @ param < T > template argument provide... | RequestBody body = RequestBody . create ( JSON , JSON_MAPPER . writeValueAsString ( updated ) ) ; Request . Builder requestBuilder = new Request . Builder ( ) . put ( body ) . url ( getResourceUrl ( checkNamespace ( updated ) , checkName ( updated ) ) ) ; return handleResponse ( requestBuilder , type , parameters ) ; |
public class IntCounter { /** * Subtracts the counts in the given Counter from the counts in this Counter .
* To copy the values from another Counter rather than subtracting them , use */
public void subtractAll ( IntCounter < E > counter ) { } } | for ( E key : map . keySet ( ) ) { decrementCount ( key , counter . getIntCount ( key ) ) ; } |
public class PortletAppTypeImpl { /** * Returns all < code > portlet < / code > elements
* @ return list of < code > portlet < / code > */
public List < PortletType < PortletAppType < T > > > getAllPortlet ( ) { } } | List < PortletType < PortletAppType < T > > > list = new ArrayList < PortletType < PortletAppType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "portlet" ) ; for ( Node node : nodeList ) { PortletType < PortletAppType < T > > type = new PortletTypeImpl < PortletAppType < T > > ( this , "portlet" , childNod... |
public class MessageFormat { /** * Sets the Format objects to use for the format elements in the
* previously set pattern string .
* The order of formats in < code > newFormats < / code > corresponds to
* the order of format elements in the pattern string .
* If more formats are provided than needed by the patt... | int formatNumber = 0 ; for ( int partIndex = 0 ; formatNumber < newFormats . length && ( partIndex = nextTopLevelArgStart ( partIndex ) ) >= 0 ; ) { setCustomArgStartFormat ( partIndex , newFormats [ formatNumber ] ) ; ++ formatNumber ; } |
public class WebAppDispatcherContext { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . webcontainer . webapp . IWebAppDispatcherContext # setContextPath ( java . lang . String ) */
public void setContextPath ( String _contextPath ) { } } | if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setContextPath" , "contextPath -> " + _contextPath + " ,this -> " + this ) ; } this . _contextPath = _contextPath ; |
public class TreeDataEvent { /** * Replies the list of current data .
* @ return the list of current data . */
@ Pure public List < Object > getCurrentValues ( ) { } } | if ( this . allValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . allValues ) ; |
public class JavaZipFileSystem { /** * { @ inheritDoc } */
public CodeSigner [ ] getCodeSigners ( VirtualFile mountPoint , VirtualFile target ) { } } | final ZipNode zipNode = getZipNode ( mountPoint , target ) ; if ( zipNode == null ) { return null ; } JarEntry jarEntry = zipNode . entry ; return jarEntry . getCodeSigners ( ) ; |
public class DsParser { /** * Store validation
* @ param v The validation
* @ param writer The writer
* @ exception Exception Thrown if an error occurs */
protected void storeValidation ( Validation v , XMLStreamWriter writer ) throws Exception { } } | writer . writeStartElement ( XML . ELEMENT_VALIDATION ) ; if ( v . getValidConnectionChecker ( ) != null ) { storeExtension ( v . getValidConnectionChecker ( ) , writer , XML . ELEMENT_VALID_CONNECTION_CHECKER ) ; } if ( v . getCheckValidConnectionSql ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_CHECK_VAL... |
public class GRPCUtils { /** * Create an evaluator descriptor info from an EvalautorDescriptor object .
* @ param descriptor object
* @ return EvaluatorDescriptorInfo */
public static EvaluatorDescriptorInfo toEvaluatorDescriptorInfo ( final EvaluatorDescriptor descriptor ) { } } | if ( descriptor == null ) { return null ; } EvaluatorDescriptorInfo . NodeDescriptorInfo nodeDescriptorInfo = descriptor . getNodeDescriptor ( ) == null ? null : EvaluatorDescriptorInfo . NodeDescriptorInfo . newBuilder ( ) . setHostName ( descriptor . getNodeDescriptor ( ) . getName ( ) ) . setId ( descriptor . getNod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.