signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class XPostfixOperationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case XbasePackage . XPOSTFIX_OPERATION__OPERAND : return operand != null ; } return super . eIsSet ( featureID ) ;
public class PlatformDefaultImpl { /** * Sets platform information for if the jdbc driver / db combo support * batch operations . Will only be checked once , then have same batch * support setting for the entire session . * @ param conn */ protected void checkForBatchSupport ( Connection conn ) { } }
if ( ! m_batchUpdatesChecked ) { DatabaseMetaData meta ; try { meta = conn . getMetaData ( ) ; m_supportsBatchUpdates = meta . supportsBatchUpdates ( ) ; } catch ( Throwable th ) { log . info ( "Batch support check failed" , th ) ; m_supportsBatchUpdates = false ; } finally { m_batchUpdatesChecked = true ; } }
public class AbsSetting { /** * 获取long类型属性值 * @ param key 属性名 * @ param group 分组名 * @ return 属性值 */ public Long getLong ( String key , String group ) { } }
return getLong ( key , group , null ) ;
public class BlockHeartbeatPRequest { /** * < pre > * * the map of added blocks on all tiers * < / pre > * < code > map & lt ; string , . alluxio . grpc . block . TierList & gt ; addedBlocksOnTiers = 4 ; < / code > */ public alluxio . grpc . TierList getAddedBlocksOnTiersOrDefault ( java . lang . String key , all...
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } java . util . Map < java . lang . String , alluxio . grpc . TierList > map = internalGetAddedBlocksOnTiers ( ) . getMap ( ) ; return map . containsKey ( key ) ? map . get ( key ) : defaultValue ;
public class DMNKnowledgeBuilderError { /** * Builds a DMNKnowledgeBuilderError from a DMNMessage associated with the given Resource * @ param resource the DMN model resource * @ param namespace * @ param m the DMNMessage belonging to the given DMN model resource * @ return */ public static DMNKnowledgeBuilderE...
ResultSeverity rs = ResultSeverity . ERROR ; switch ( m . getLevel ( ) ) { case ERROR : rs = ResultSeverity . ERROR ; break ; case INFO : rs = ResultSeverity . INFO ; break ; case WARNING : rs = ResultSeverity . WARNING ; break ; default : rs = ResultSeverity . ERROR ; break ; } DMNKnowledgeBuilderError res = new DMNKn...
public class TagMaskUtils { /** * Returns a TagMask with the attributes collected from the given token . * @ param token * the token whose attributes will be collected . * @ param text * a string containing the attributes to get from the token , * e . g . , " number gender " * @ returna a TagMask object wit...
TagMask tm = new TagMask ( ) ; Matcher m = REPLACE_R2 . matcher ( text ) ; while ( m . find ( ) ) { String property = m . group ( 1 ) ; switch ( property ) { case "number" : tm . setNumber ( token . getMorphologicalTag ( ) . getNumberE ( ) ) ; break ; case "gender" : tm . setGender ( token . getMorphologicalTag ( ) . g...
public class RemoteOracle { /** * Factory method to use in order to get a { @ link RemoteOracle } instance . * @ param suggest _ type The type of suggestion wanted . * @ param textbox The text box to wrap to provide suggestions to . */ public static SuggestBox newSuggestBox ( final String suggest_type , final TextB...
final RemoteOracle oracle = new RemoteOracle ( suggest_type ) ; final SuggestBox box = new SuggestBox ( oracle , textbox ) ; oracle . requester = box ; return box ;
public class GregorianCalendar { /** * Returns the fixed date of the first date of the month ( usually * the 1st of the month ) before the specified date . * @ param date the date for which the first day of the month is * calculated . The date has to be in the cut - over year ( Gregorian * or Julian ) . * @ p...
assert date . getNormalizedYear ( ) == gregorianCutoverYear || date . getNormalizedYear ( ) == gregorianCutoverYearJulian ; BaseCalendar . Date gCutover = getGregorianCutoverDate ( ) ; if ( gCutover . getMonth ( ) == BaseCalendar . JANUARY && gCutover . getDayOfMonth ( ) == 1 ) { // The cutover happened on January 1. r...
public class ParameterFactoryImpl { /** * Creates a parameter . * @ param name name of the parameter * @ param value a parameter value * @ return a component * @ throws URISyntaxException thrown when the specified string is not a valid representation of a URI for selected * parameters */ public Parameter crea...
final ParameterFactory factory = getFactory ( name ) ; Parameter parameter ; if ( factory != null ) { parameter = factory . createParameter ( value ) ; } else if ( isExperimentalName ( name ) ) { parameter = new XParameter ( name , value ) ; } else if ( allowIllegalNames ( ) ) { parameter = new XParameter ( name , valu...
public class StreamUtils { /** * Converts nullable long array into an empty stream , and non - null array into a stream . * @ param nullable The nullable array to convert . * @ return A stream of zero or more values . */ public static LongStream ofNullable ( long [ ] nullable ) { } }
return null == nullable ? LongStream . empty ( ) : Arrays . stream ( nullable ) ;
public class JvmTypeReferenceBuilder { /** * Creates a new wildcard type reference with the given type as the lower bound and { @ link Object } as upper bound . * For example : * < pre > wildcardSuper ( typeRef ( CharSequence ) ) < / pre > * would create a type reference representing * < pre > ? super CharSeque...
WildcardTypeReference wildcardTypeReference = typeReferenceOwner . newWildcardTypeReference ( ) ; wildcardTypeReference . addUpperBound ( typeReferenceOwner . toLightweightTypeReference ( typeRef ( Object . class ) ) ) ; wildcardTypeReference . setLowerBound ( typeReferenceOwner . toLightweightTypeReference ( superBoun...
public class CommonG { /** * Capture a snapshot or an evidence in the driver * @ param driver driver used for testing * @ param type type * @ param suffix suffix * @ return String */ public String captureEvidence ( WebDriver driver , String type , String suffix ) { } }
String testSuffix = System . getProperty ( "TESTSUFFIX" ) ; String dir = "./target/executions/" ; if ( testSuffix != null ) { dir = dir + testSuffix + "/" ; } String clazz = ThreadProperty . get ( "class" ) ; String currentBrowser = ThreadProperty . get ( "browser" ) ; String currentData = ThreadProperty . get ( "dataS...
public class AvPairs { /** * Replace all occurances of the given type * @ param pairs * @ param rep */ public static void replace ( List < AvPair > pairs , AvPair rep ) { } }
remove ( pairs , rep . getType ( ) ) ; pairs . add ( rep ) ;
public class JobInitializationPoller { /** * Convenience method to check if job has been scheduled or not . * The method may return false in case of job which has failure but * has not failed the tip . * @ param job * @ return */ private boolean isScheduled ( JobInProgress job ) { } }
return ( ( job . pendingMaps ( ) < job . desiredMaps ( ) ) || ( job . pendingReduces ( ) < job . desiredReduces ( ) ) ) ;
public class TargetsMngrImpl { /** * Associating targets and application instances / components */ @ Override public void associateTargetWith ( String targetId , AbstractApplication app , String instancePathOrComponentName ) throws IOException , UnauthorizedActionException { } }
boolean valid = false ; if ( instancePathOrComponentName == null ) { valid = true ; } else if ( instancePathOrComponentName . startsWith ( "@" ) ) { Component comp = ComponentHelpers . findComponent ( app , instancePathOrComponentName . substring ( 1 ) ) ; valid = comp != null ; } else { Instance instance = InstanceHel...
public class MapUtils { /** * Pairs up the values of a map by their common keys . */ public static < K , V > PairedMapValues < V > zipValues ( final Map < K , V > left , final Map < K , V > right ) { } }
checkNotNull ( left ) ; checkNotNull ( right ) ; final ImmutableList . Builder < ZipPair < V , V > > pairedValues = ImmutableList . builder ( ) ; final ImmutableList . Builder < V > leftOnly = ImmutableList . builder ( ) ; final ImmutableList . Builder < V > rightOnly = ImmutableList . builder ( ) ; for ( final Map . E...
public class NotExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case SimpleAntlrPackage . NOT_EXPRESSION__VALUE : return getValue ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class Type { /** * Returns the descriptor corresponding to the given constructor . * @ param c * a { @ link Constructor Constructor } object . * @ return the descriptor of the given constructor . */ public static String getConstructorDescriptor ( final Constructor < ? > c ) { } }
Class < ? > [ ] parameters = c . getParameterTypes ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( '(' ) ; for ( int i = 0 ; i < parameters . length ; ++ i ) { getDescriptor ( buf , parameters [ i ] ) ; } return buf . append ( ")V" ) . toString ( ) ;
public class JideViewDescriptor { /** * Compares the display names of the view descriptors */ public int compareTo ( Object o ) { } }
ViewDescriptor castObj = ( ViewDescriptor ) o ; return this . getDisplayName ( ) . compareToIgnoreCase ( castObj . getDisplayName ( ) ) ;
public class CompositeCallbackImpl { /** * Removes specified callback from this callback , properly cleans up the removed callback . * @ param callback removed child - callback */ @ Override public void removeCallback ( Callback callback ) { } }
callbacks . remove ( callback ) ; if ( manager != null ) { callback . cleanup ( ) ; }
public class UpdateRoomImpl { /** * Execute update room variables */ @ SuppressWarnings ( "unchecked" ) @ Override public ApiRoom execute ( ) { } }
Room sfsRoom = CommandUtil . getSfsRoom ( agent , extension ) ; User sfsUser = CommandUtil . getSfsUser ( user , api ) ; // check null if ( sfsRoom == null ) return null ; // get variables from agent AgentClassUnwrapper unwrapper = context . getRoomAgentClass ( agent . getClass ( ) ) . getUnwrapper ( ) ; List < RoomVar...
public class PowerFormsApi { /** * Returns the form data associated with the usage of a PowerForm . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param powerFormId ( required ) * @ return PowerFormsFormDataResponse */ public PowerFormsFormDataResponse getPowerFormDa...
return getPowerFormData ( accountId , powerFormId , null ) ;
public class AbstractCalculator { /** * Bind another Calculator class functionalities to expression . * Way to combine two different implementation of calculators * @ param clazz * @ return */ public < T extends AbstractCalculator > T bind ( Class < T > clazz ) { } }
T childCalc = null ; try { childCalc = clazz . newInstance ( ) ; } catch ( Exception e ) { throw new CalculatorException ( e ) ; } if ( childCalc instanceof AbstractCalculator ) { // find last child from root AbstractCalculator < CALC > bParent = this ; while ( bParent != null ) { if ( bParent . childCalculator != null...
public class PDTXMLConverter { /** * Get the passed { @ link XMLGregorianCalendar } as { @ link ZonedDateTime } . * @ param aCal * The source { @ link XMLGregorianCalendar } . May be < code > null < / code > . * @ return < code > null < / code > if the parameter is < code > null < / code > . */ @ Nullable public ...
if ( aCal == null ) return null ; return getGregorianCalendar ( aCal ) . toZonedDateTime ( ) ;
public class TypedCollections { /** * Dynamically check that the keys and values in the map are all * instances of the correct types ( or null ) . * @ param < K > * the map ' s key type * @ param < V > * the map ' s value type * @ param map * the map to cast * @ param keyType * the class of the map ' ...
if ( map == null ) { return null ; } assert checkCollectionMembers ( map . keySet ( ) , keyType ) : "The map contains keys with a type other than " + keyType . getName ( ) ; assert checkCollectionMembers ( map . values ( ) , valueType ) : "The map contains values with a type other than " + valueType . getName ( ) ; ret...
public class UnrelatedReturnValues { /** * looks for a common superclass or interface for all the passed in types * @ param classes * the set of classes to look for a common super class or interface * @ return the type that is the common interface or superclass ( not Object , tho ) . * @ throws ClassNotFoundExc...
Set < JavaClass > possibleCommonTypes = new HashSet < > ( ) ; boolean populate = true ; for ( JavaClass cls : classes ) { if ( cls == null ) { return null ; } if ( Values . SLASHED_JAVA_LANG_OBJECT . equals ( cls . getClassName ( ) ) ) { continue ; } JavaClass [ ] infs = cls . getAllInterfaces ( ) ; JavaClass [ ] super...
public class Unchecked { /** * Wrap a { @ link CheckedIntToDoubleFunction } in a { @ link IntToDoubleFunction } with a custom handler for checked exceptions . * Example : * < code > < pre > * IntStream . of ( 1 , 2 , 3 ) . mapToDouble ( Unchecked . intToDoubleFunction ( * if ( i & lt ; 0) * throw new Exceptio...
return t -> { try { return function . applyAsDouble ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class Measure { /** * Calculates the value of measure * @ param values */ public void computeValue ( DoubleVector values ) { } }
if ( this . isType ( ) ) { setValues ( values ) ; double sumDif = 0.0 ; this . value = this . values . sumOfValues ( ) / ( double ) values . numValues ( ) ; for ( int i = 0 ; i < this . values . numValues ( ) ; i ++ ) { double dif = this . values . getValue ( i ) - this . value ; sumDif += Math . pow ( dif , 2 ) ; } su...
public class BatchDetectDominantLanguageItemResult { /** * One or more < a > DominantLanguage < / a > objects describing the dominant languages in the document . * @ param languages * One or more < a > DominantLanguage < / a > objects describing the dominant languages in the document . */ public void setLanguages (...
if ( languages == null ) { this . languages = null ; return ; } this . languages = new java . util . ArrayList < DominantLanguage > ( languages ) ;
public class Utility { /** * Convert all escapes in a given string using unescapeAt ( ) . * @ exception IllegalArgumentException if an invalid escape is * seen . */ public static String unescape ( String s ) { } }
StringBuilder buf = new StringBuilder ( ) ; int [ ] pos = new int [ 1 ] ; for ( int i = 0 ; i < s . length ( ) ; ) { char c = s . charAt ( i ++ ) ; if ( c == '\\' ) { pos [ 0 ] = i ; int e = unescapeAt ( s , pos ) ; if ( e < 0 ) { throw new IllegalArgumentException ( "Invalid escape sequence " + s . substring ( i - 1 ,...
public class RequestContext { /** * Retrieves the configuration annotation for the given interceptor . * @ param interceptor the interceptor * @ return the configuration , { @ code null } if not found */ < A > A getConfigurationForInterceptor ( Interceptor < A > interceptor ) { } }
return ( A ) interceptors . get ( interceptor ) ;
public class AWSAppSyncClient { /** * Retrieves the current status of a schema creation operation . * @ param getSchemaCreationStatusRequest * @ return Result of the GetSchemaCreationStatus operation returned by the service . * @ throws BadRequestException * The request is not well formed . For example , a valu...
request = beforeClientExecution ( request ) ; return executeGetSchemaCreationStatus ( request ) ;
public class NettyConnection { /** * Handles a request response . */ private void handleRequestSuccess ( long requestId , Object response , ThreadContext context ) { } }
ByteBuf buffer = channel . alloc ( ) . buffer ( 10 ) . writeByte ( RESPONSE ) . writeLong ( requestId ) . writeByte ( SUCCESS ) ; try { writeResponse ( buffer , response , context ) ; } catch ( SerializationException e ) { handleRequestFailure ( requestId , e , context ) ; return ; } channel . writeAndFlush ( buffer , ...
public class CasTicketUserInfoService { /** * Looks for a security context * @ param context the principal security context * @ return the CAS security context , or null if not found . */ @ SuppressWarnings ( "unchecked" ) private static ISecurityContext getCasContext ( ISecurityContext context ) { } }
if ( context instanceof ICasSecurityContext ) { return context ; } Enumeration contextEnum = context . getSubContexts ( ) ; while ( contextEnum . hasMoreElements ( ) ) { ISecurityContext subContext = ( ISecurityContext ) contextEnum . nextElement ( ) ; if ( subContext instanceof ICasSecurityContext ) { return subContex...
public class RxSharedPreferences { /** * Create a boolean preference for { @ code key } with a default of { @ code defaultValue } . */ @ CheckResult @ NonNull public Preference < Boolean > getBoolean ( @ NonNull String key , @ NonNull Boolean defaultValue ) { } }
checkNotNull ( key , "key == null" ) ; checkNotNull ( defaultValue , "defaultValue == null" ) ; return new RealPreference < > ( preferences , key , defaultValue , BooleanAdapter . INSTANCE , keyChanges ) ;
public class BoxApiComment { /** * Gets a request that updates a comment ' s information * @ param id id of comment to update information on * @ param newMessage new message for the comment * @ return request to update a comment ' s information */ public BoxRequestsComment . UpdateComment getUpdateRequest ( Strin...
BoxRequestsComment . UpdateComment request = new BoxRequestsComment . UpdateComment ( id , newMessage , getCommentInfoUrl ( id ) , mSession ) ; return request ;
public class FnLong { /** * It divides the target element by the given divisor and returns its result rounded * based on the specified rounding mode * @ param divisor the divisor * @ param roundingMode the { @ link RoundingMode } * @ return the result of target / divisor */ public final static Function < Long ,...
return new Divide ( fromNumber ( divisor ) , roundingMode ) ;
public class MatrixVectorWriter { /** * Prints the coordinate format to the underlying stream . One index pair and * entry on each line . The offset is added to each index , typically , this * can transform from a 0 - based indicing to a 1 - based . */ public void printCoordinate ( int [ ] row , int [ ] column , lo...
int size = row . length ; if ( size != column . length || size != data . length ) throw new IllegalArgumentException ( "All arrays must be of the same size" ) ; for ( int i = 0 ; i < size ; ++ i ) format ( Locale . ENGLISH , "%10d %10d %19d%n" , row [ i ] + offset , column [ i ] + offset , data [ i ] ) ;
public class DomainsInner { /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer . * Creates an ownership identifier for a domain or updates identifier details for an existing identifer . * @ param resourceGroupName Name of the resource group to which the resour...
return ServiceFuture . fromResponse ( createOrUpdateOwnershipIdentifierWithServiceResponseAsync ( resourceGroupName , domainName , name , domainOwnershipIdentifier ) , serviceCallback ) ;
public class MeshOrganizer { /** * This method marks given Node as offline , remapping its downstreams * @ param node */ public void markNodeOffline ( @ NonNull Node node ) { } }
synchronized ( node ) { node . status ( NodeStatus . OFFLINE ) ; for ( val n : node . getDownstreamNodes ( ) ) remapNode ( n ) ; }
import java . math . * ; class SumOddPowers { /** * A Java function that calculates the sum of the fifth powers of the first ' power _ count ' odd natural numbers . * > > > sumOddPowers ( 1) * > > > sumOddPowers ( 2) * 244 * > > > sumOddPowers ( 3) * 3369 */ public static BigInteger sumOddPowers ( int powerCo...
BigInteger totalSum = new BigInteger ( "0" ) ; for ( int i = 1 ; i <= powerCount ; i ++ ) { int oddInt = ( 2 * i ) - 1 ; totalSum = totalSum . add ( BigInteger . valueOf ( oddInt ) . pow ( 5 ) ) ; } return totalSum ;
public class Response { /** * add a status message to the response * @ param statusMessage * status message * @ param solution * detailed description and solution */ @ SuppressWarnings ( "unchecked" ) protected void addStatusMessage ( final String statusMessage , final String solution ) { } }
this . json . put ( ProtocolConstants . SOLUTION , solution ) ; this . json . put ( ProtocolConstants . STATUS_MESSAGE , statusMessage ) ;
public class GeoJsonWriteDriver { /** * Write a JTS geometry to its GeoJSON geometry representation . * Syntax : * " geometry " : { " type " : " Point " , " coordinates " : [ 102.0 , 0.5 ] } * @ param jsonGenerator * @ param geometry */ private void writeGeometry ( Geometry geom , JsonGenerator gen ) throws IOE...
if ( geom != null ) { gen . writeObjectFieldStart ( "geometry" ) ; if ( geom instanceof Point ) { write ( ( Point ) geom , gen ) ; } else if ( geom instanceof MultiPoint ) { write ( ( MultiPoint ) geom , gen ) ; } else if ( geom instanceof LineString ) { write ( ( LineString ) geom , gen ) ; } else if ( geom instanceof...
public class HostSystem { /** * SDK5.0 signature */ public Task reconnectHost_Task ( HostConnectSpec cnxSpec , HostSystemReconnectSpec reconnectSpec ) throws InvalidName , InvalidLogin , InvalidState , HostConnectFault , RuntimeFault , RemoteException { } }
ManagedObjectReference mor = getVimService ( ) . reconnectHost_Task ( getMOR ( ) , cnxSpec , reconnectSpec ) ; return new Task ( getServerConnection ( ) , mor ) ;
public class Database { /** * Compile and return SQLite VM for SQL statement . Only available * in SQLite 2.8.0 and above , otherwise a no - op . * @ param sql SQL statement to be compiled * @ return a Vm object */ public Vm compile ( String sql ) throws jsqlite . Exception { } }
synchronized ( this ) { Vm vm = new Vm ( ) ; vm_compile ( sql , vm ) ; return vm ; }
public class ConjugateGradient { /** * Uses the Conjugate Gradient method to solve a linear system of * equations involving a symmetric positive definite matrix . < br > < br > * A symmetric positive definite matrix is a matrix A such that : < br > * < ul > * < li > A < sup > T < / sup > = A < / li > * < li >...
if ( ! A . isSquare ( ) ) throw new ArithmeticException ( "A must be a square (symmetric & positive definite) matrix" ) ; else if ( A . rows ( ) != b . length ( ) || A . rows ( ) != x . length ( ) ) throw new ArithmeticException ( "Matrix A dimensions do not agree with x and b" ) ; int k = 0 ; Vec r_k = b . subtract ( ...
public class ReservoirItemsSketch { /** * Randomly decide whether or not to include an item in the sample set . * @ param item a unit - weight ( equivalently , unweighted ) item of the set being sampled from */ public void update ( final T item ) { } }
if ( itemsSeen_ == MAX_ITEMS_SEEN ) { throw new SketchesStateException ( "Sketch has exceeded capacity for total items seen: " + MAX_ITEMS_SEEN ) ; } if ( item == null ) { return ; } if ( itemsSeen_ < reservoirSize_ ) { // initial phase , take the first reservoirSize _ items if ( itemsSeen_ >= currItemsAlloc_ ) { growR...
public class FctBnAccEntitiesProcessors { /** * < p > Get PrcSalesInvoiceLineGfr ( create and put into map ) . < / p > * @ param pAddParam additional param * @ return requested PrcSalesInvoiceLineGfr * @ throws Exception - an exception */ protected final PrcSalesInvoiceLineGfr lazyGetPrcSalesInvoiceLineGfr ( fina...
@ SuppressWarnings ( "unchecked" ) PrcSalesInvoiceLineGfr < RS > proc = ( PrcSalesInvoiceLineGfr < RS > ) this . processorsMap . get ( PrcSalesInvoiceLineGfr . class . getSimpleName ( ) ) ; if ( proc == null ) { proc = new PrcSalesInvoiceLineGfr < RS > ( ) ; @ SuppressWarnings ( "unchecked" ) PrcEntityPbCopy < RS , Sal...
public class BaseMessageItemStream { /** * Fire an event notification of type TYPE _ SIB _ MESSAGEPOINT _ DEPTH _ THRESHOLD _ REACHED * @ param newState */ public void fireDepthThresholdReachedEvent ( ControlAdapter cAdapter , boolean reachedHigh , long numMsgs , long msgLimit ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "fireDepthThresholdReachedEvent" , new Object [ ] { cAdapter , new Boolean ( reachedHigh ) , new Long ( numMsgs ) } ) ; // Retrieve appropriate information String destinationName = destinationHandler . getName ( ) ; String m...
public class BinarySearcher { /** * Search bytes in byte array returns indexes within this byte - array of all * occurrences of the specified ( search bytes ) byte array . * @ param srcBytes * @ param searchBytes * @ return result index list */ public List < Integer > searchBytes ( byte [ ] srcBytes , byte [ ] ...
final int startIdx = 0 ; final int endIdx = srcBytes . length - 1 ; return searchBytes ( srcBytes , searchBytes , startIdx , endIdx ) ;
public class Category { /** * Remove all previously added appenders from this Category instance . * This is useful when re - reading configuration information . */ public void removeAllAppenders ( ) { } }
for ( Appender appender : aai . getAppenders ( ) ) { aai . removeAppender ( appender ) ; fireRemoveAppenderEvent ( appender ) ; }
public class UnorderedCollection { /** * Removes an element by its index . */ private void remove ( int index ) { } }
int lastIndex = -- size ; Reference < E > removed = storage . array [ index ] ; Reference < E > lastElem = storage . array [ lastIndex ] ; storage . array [ index ] = lastElem ; lastElem . index = index ; removed . index = - 1 ; storage . array [ lastIndex ] = null ;
public class QueryTable { /** * QueryTable Constructor . * @ param database The database for this table . * @ param record The queryRecord for this table . */ public void init ( BaseDatabase database , Record record ) { } }
super . init ( database , record ) ; if ( ( ( QueryRecord ) record ) . getBaseRecord ( ) != null ) m_tableNext = ( ( QueryRecord ) record ) . getBaseRecord ( ) . getTable ( ) ; // Pass most commands thru to the main record ' s table
public class ShapeGenerator { /** * Return a path for a focus rectangle . * < p > This path is suitable for filling . < / p > * @ param x the X coordinate of the upper - left corner of the rectangle * @ param y the Y coordinate of the upper - left corner of the rectangle * @ param w the width of the rectangle ...
final int left = x ; final int top = y ; final int right = x + w ; final int bottom = y + h ; path . reset ( ) ; path . moveTo ( left , top ) ; path . lineTo ( left , bottom ) ; path . lineTo ( right , bottom ) ; path . lineTo ( right , top ) ; final float offset = 1.4f ; final float left2 = left + offset ; final float...
public class CardAPI { /** * 创建折扣券 * @ param accessToken accessToken * @ param discountCard discountCard * @ return result */ public static CreateResult create ( String accessToken , DiscountCard discountCard ) { } }
Create < DiscountCard > card = new Create < DiscountCard > ( ) ; card . setCard ( discountCard ) ; return create ( accessToken , card ) ;
public class Gson { /** * This method deserializes the Json read from the specified parse tree into an object of the * specified type . This method is useful if the specified object is a generic type . For * non - generic objects , use { @ link # fromJson ( JsonElement , Class ) } instead . * @ param < T > the ty...
if ( json == null ) { return null ; } return ( T ) fromJson ( new JsonTreeReader ( json ) , typeOfT ) ;
public class SVNController { /** * Creating a configuration */ @ RequestMapping ( value = "configurations/create" , method = RequestMethod . POST ) public SVNConfiguration newConfiguration ( @ RequestBody SVNConfiguration configuration ) { } }
return svnConfigurationService . newConfiguration ( configuration ) ;
public class DIRImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . DIR__RLENGTH : setRLENGTH ( ( Integer ) newValue ) ; return ; case AfplibPackage . DIR__RWIDTH : setRWIDTH ( ( Integer ) newValue ) ; return ; case AfplibPackage . DIR__RWIDTHFRACTION : setRWIDTHFRACTION ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValu...
public class HtmlTree { /** * Generates a CODE tag with some content . * @ param body content for the tag * @ return an HtmlTree object for the CODE tag */ public static HtmlTree CODE ( Content body ) { } }
HtmlTree htmltree = new HtmlTree ( HtmlTag . CODE , nullCheck ( body ) ) ; return htmltree ;
public class StringUtils { /** * Find last not of . * @ param container the container * @ param charSeq the char seq * @ param end the end * @ return the int */ public static int findLastNotOf ( String container , String charSeq , int end ) { } }
for ( int i = end ; i < container . length ( ) && i >= 0 ; -- i ) { if ( ! charSeq . contains ( "" + container . charAt ( i ) ) ) return i ; } return - 1 ;
public class URIName { /** * Return subtree depth of this name for purposes of determining * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees . * @ returns distance of name from root * @ throws UnsupportedOperationException if not supported for this name type */ pub...
DNSName dnsName = null ; try { dnsName = new DNSName ( host ) ; } catch ( IOException ioe ) { throw new UnsupportedOperationException ( ioe . getMessage ( ) ) ; } return dnsName . subtreeDepth ( ) ;
public class BigIntegerExtensions { /** * The binary < code > minus < / code > operator . * @ param a * a BigInteger . May not be < code > null < / code > . * @ param b * a BigInteger . May not be < code > null < / code > . * @ return < code > a . subtract ( b ) < / code > * @ throws NullPointerException ...
return a . subtract ( b ) ;
public class LogTransformer { /** * transform0 sees if the className starts with any of the namespaces to * ignore , if so it is returned unchanged . Otherwise it is processed by * doClass ( . . . ) * @ param className * @ param clazz * @ param domain * @ param bytes * @ return */ private byte [ ] transfo...
try { for ( int i = 0 ; i < ignore . length ; i ++ ) { if ( className . startsWith ( ignore [ i ] ) ) { return bytes ; } } String slf4jName = "org.slf4j.LoggerFactory" ; try { if ( domain != null && domain . getClassLoader ( ) != null ) { domain . getClassLoader ( ) . loadClass ( slf4jName ) ; } else { if ( verbose ) {...
public class StatisticalAssignmentPolicy { /** * get the index of the forest with smallest number of docs */ @ Override public int getPlacementForestIndex ( DocumentURI uri ) { } }
int idx = 0 ; try { idx = popAndInsert ( ) ; } catch ( InterruptedException e ) { LOG . error ( "Statistical assignment gets interrupted" ) ; } return idx ;
public class CmsObject { /** * Returns the groups of a user filtered by the specified IP address . < p > * @ param username the name of the user * @ param directGroupsOnly if set only the direct assigned groups will be returned , if not also indirect roles * @ param remoteAddress the IP address to filter the grou...
return m_securityManager . getGroupsOfUser ( m_context , username , ( includeOtherOus ? "" : CmsOrganizationalUnit . getParentFqn ( username ) ) , includeOtherOus , false , directGroupsOnly , remoteAddress ) ;
public class FragmentBundlerCompat { /** * Inserts a List of Parcelable values into the mapping of the underlying Bundle , replacing any * existing value for the given key . Either key or value may be null . * @ param key a String , or null * @ param value an ArrayList of Parcelable objects , or null * @ return...
bundler . putParcelableArrayList ( key , value ) ; return this ;
public class TimeUtil { /** * get and return the time key part of the specified entity string * @ param entity * @ return String */ public static final String getTimeKey ( String entity ) { } }
if ( entity == null ) { return null ; } int sIdx = entity . indexOf ( '.' ) ; if ( sIdx == - 1 ) { return null ; } return entity . substring ( sIdx + 1 ) ;
public class BeanO { /** * Mark the current global transaction for rollback . < p > * Invoking the setRollbackOnly method is disallowed in the bean * methods for which the container does not have a meaningful * transaction context . These are the methods that have the * NotSupported , Never , or Supports transa...
ContainerTx tx = null ; IllegalStateException ise = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly: " + this ) ; // setRollbackOnly is not allowed when the container does not have // a meaningful transaction context , which includes the tx attrs // N...
public class Utils { /** * Checks if the given array contains any non - empty options . * @ param options an array of strings * @ exception Exception if there are any non - empty options */ public static void checkForRemainingOptions ( String [ ] options ) throws Exception { } }
int illegalOptionsFound = 0 ; StringBuffer text = new StringBuffer ( ) ; if ( options == null ) { return ; } for ( int i = 0 ; i < options . length ; i ++ ) { if ( options [ i ] . length ( ) > 0 ) { illegalOptionsFound ++ ; text . append ( options [ i ] + ' ' ) ; } } if ( illegalOptionsFound > 0 ) { throw new Exception...
public class GenericPublisher { /** * { @ inheritDoc } */ @ Override public void publish ( Message message , DeliveryOptions deliveryOptions ) throws IOException { } }
publisher . publish ( message , deliveryOptions ) ;
public class CombinedStringDistanceLearner { /** * Pass new labels to the sublearners . */ public void addExample ( DistanceInstance answeredQuery ) { } }
MyMultiDistanceInstance di = asMultiDistanceInstance ( answeredQuery ) ; for ( int i = 0 ; i < innerLearners . length ; i ++ ) { innerLearners [ i ] . addExample ( di . get ( i ) ) ; } comboAddExample ( di ) ;
public class RegistriesInner { /** * Schedules a new run based on the request parameters and add it to the run queue . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runRequest The parameter...
return ServiceFuture . fromResponse ( beginScheduleRunWithServiceResponseAsync ( resourceGroupName , registryName , runRequest ) , serviceCallback ) ;
public class HttpRequestHandler { /** * Handling an option request which is used for preflight checks before a CORS based browser request is * sent ( for certain circumstances ) . * See the < a href = " http : / / www . w3 . org / TR / cors / " > CORS specification < / a > * ( section ' preflight checks ' ) for m...
Map < String , String > ret = new HashMap < String , String > ( ) ; if ( backendManager . isOriginAllowed ( pOrigin , false ) ) { // CORS is allowed , we set exactly the origin in the header , so there are no problems with authentication ret . put ( "Access-Control-Allow-Origin" , pOrigin == null || "null" . equals ( p...
public class SelectMultiMenuRenderer { /** * Renders a single & lt ; option & gt ; tag . For some reason , * < code > SelectItem < / code > and < code > UISelectItem < / code > don ' t share a * common interface , so this method is repeated twice . * @ param rw * The response writer * @ param selectItem * T...
String itemLabel = selectItem . getItemLabel ( ) ; final String itemDescription = selectItem . getItemDescription ( ) ; final Object itemValue = selectItem . getItemValue ( ) ; boolean isItemLabelBlank = itemLabel == null || itemLabel . trim ( ) . length ( ) == 0 ; itemLabel = isItemLabelBlank ? "&nbsp;" : itemLabel ; ...
public class Standby { /** * Checks the status of image validation during checkpoint . * @ throws IOException */ private void checkImageValidation ( ) throws IOException { } }
try { imageValidator . join ( ) ; } catch ( InterruptedException ie ) { throw ( IOException ) new InterruptedIOException ( ) . initCause ( ie ) ; } if ( ! imageValidator . succeeded ) { throw new IOException ( "Image file validation failed" , imageValidator . error ) ; }
public class EpisodicUtil { /** * A simple method for joining an array of strings to a comma seperated string . * @ param strings An array of strings . * @ return The array as single string joined by commas */ public static String join ( String [ ] strings ) { } }
StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { builder . append ( strings [ i ] ) ; if ( i + 1 < strings . length ) builder . append ( "," ) ; } return builder . toString ( ) ;
public class LightWeightGSet { /** * Remove the element corresponding to the key , * given key . hashCode ( ) = = index . * @ return If such element exists , return it . * Otherwise , return null . */ private E remove ( final int index , final K key ) { } }
if ( entries [ index ] == null ) { return null ; } else if ( entries [ index ] . equals ( key ) ) { // remove the head of the linked list modification ++ ; size -- ; final LinkedElement e = entries [ index ] ; entries [ index ] = e . getNext ( ) ; e . setNext ( null ) ; return convert ( e ) ; } else { // head ! = null ...
public class HttpUtils { /** * ported from httpFileRequested ( above ) */ public static void writeIfModified ( HttpAcceptSession httpSession , File requestFile ) throws IOException { } }
if ( requestFile . isFile ( ) && requestFile . exists ( ) ) { String etag = getETagHeaderValue ( requestFile ) ; String ifNoneMatch = httpSession . getReadHeader ( "If-None-Match" ) ; String ifModifiedSince = httpSession . getReadHeader ( "If-Modified-Since" ) ; if ( ! hasBeenModified ( requestFile , etag , ifNoneMatch...
public class FocusManager { /** * Takes focus from current focused widget ( if any ) , and sets current focused widget to null . If widgets owns * keyboard focus { @ link # resetFocus ( Stage , Actor ) } should be always preferred . * @ param stage if passed stage is not null then stage keyboard focus will be set t...
if ( focusedWidget != null ) focusedWidget . focusLost ( ) ; if ( stage != null ) stage . setKeyboardFocus ( null ) ; focusedWidget = null ;
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createCGB ( ) */ @ Override public CircuitGroupBlockingMessage createCGB ( ) { } }
CircuitGroupBlockingMessage cgb = new CircuitGroupBlockingMessageImpl ( _CGB_HOLDER . mandatoryCodes , _CGB_HOLDER . mandatoryVariableCodes , _CGB_HOLDER . optionalCodes , _CGB_HOLDER . mandatoryCodeToIndex , _CGB_HOLDER . mandatoryVariableCodeToIndex , _CGB_HOLDER . optionalCodeToIndex ) ; return cgb ;
public class RelationalOperations { /** * Returns true if polyline _ a touches point _ b . */ private static boolean polylineTouchesPoint_ ( Polyline polyline_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { } }
// Quick rasterize test to see whether the the geometries are disjoint . if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , point_b , tolerance , false ) == Relation . disjoint ) return false ; Point2D pt_b = point_b . getXY ( ) ; return linearPathTouchesPointImpl_ ( polyline_a , pt_b , tolerance ) ;
public class ICalComponent { /** * Replaces all sub - components of a given class with the given component . If * the component instance is null , then all instances of that component will * be removed . * @ param clazz the component ' s class * @ param component the component or null to remove all components o...
List < ICalComponent > replaced = components . replace ( clazz , component ) ; return castList ( replaced , clazz ) ;
public class authorizationaction { /** * Use this API to fetch authorizationaction resource of given name . */ public static authorizationaction get ( nitro_service service , String name ) throws Exception { } }
authorizationaction obj = new authorizationaction ( ) ; obj . set_name ( name ) ; authorizationaction response = ( authorizationaction ) obj . get_resource ( service ) ; return response ;
public class GwtWebSocket { /** * Invoked by native listener . * @ param closeCode see { @ link WebSocketCloseCode } . * @ param reason optional closing reason . */ protected void onClose ( final int closeCode , final String reason ) { } }
postCloseEvent ( WebSocketCloseCode . getByCodeOrElse ( closeCode , WebSocketCloseCode . ABNORMAL ) , reason ) ;
public class CmsToolTipHandler { /** * Sets the tool - tip position . < p > * @ param clientLeft the mouse pointer left position relative to the client window * @ param clientTop the mouse pointer top position relative to the client window */ private void setToolTipPosition ( int clientLeft , int clientTop ) { } }
if ( m_toolTip != null ) { int height = m_toolTip . getOffsetHeight ( ) ; int width = m_toolTip . getOffsetWidth ( ) ; int windowHeight = Window . getClientHeight ( ) ; int windowWidth = Window . getClientWidth ( ) ; int scrollLeft = Window . getScrollLeft ( ) ; int scrollTop = Window . getScrollTop ( ) ; int left = cl...
public class VerificationConditionGenerator { /** * Generate a return type check in the case that it is necessary . For example , * if the return type contains a type invariant then it is likely to be * necessary . However , in the special case that the value being returned is * already of appropriate type , then...
WyilFile . Decl . FunctionOrMethod declaration = ( WyilFile . Decl . FunctionOrMethod ) context . getEnvironment ( ) . getParent ( ) . enclosingDeclaration ; Tuple < WyilFile . Type > returnTypes = declaration . getType ( ) . getReturns ( ) ; for ( int i = 0 ; i != exprs . length ; ++ i ) { WyilFile . Type returnType =...
public class UTF8String { /** * Copy the bytes from the current UTF8String , and make a new UTF8String . * @ param start the start position of the current UTF8String in bytes . * @ param end the end position of the current UTF8String in bytes . * @ return a new UTF8String in the position of [ start , end ] of cur...
int len = end - start + 1 ; byte [ ] newBytes = new byte [ len ] ; copyMemory ( base , offset + start , newBytes , BYTE_ARRAY_OFFSET , len ) ; return UTF8String . fromBytes ( newBytes ) ;
public class CmsGalleryController { /** * Gets the option which should be preselected for the site selector , or null . < p > * @ param siteRoot the site root * @ param options the list of options * @ return the key for the option to preselect */ public String getPreselectOption ( String siteRoot , List < CmsSite...
if ( ( siteRoot == null ) || options . isEmpty ( ) ) { return null ; } for ( CmsSiteSelectorOption option : options ) { if ( CmsStringUtil . joinPaths ( siteRoot , "/" ) . equals ( CmsStringUtil . joinPaths ( option . getSiteRoot ( ) , "/" ) ) ) { return option . getSiteRoot ( ) ; } } return options . get ( 0 ) . getSi...
public class RocksDBStateBackend { /** * Gets the RocksDB { @ link DBOptions } to be used for all RocksDB instances . */ public DBOptions getDbOptions ( ) { } }
// initial options from pre - defined profile DBOptions opt = getPredefinedOptions ( ) . createDBOptions ( ) ; // add user - defined options factory , if specified if ( optionsFactory != null ) { opt = optionsFactory . createDBOptions ( opt ) ; } // add necessary default options opt = opt . setCreateIfMissing ( true ) ...
public class WeakFieldStorage { /** * stores a single method * @ param field * @ param fieldsMap */ private void storeField ( Field field , StructImpl fieldsMap ) { } }
String fieldName = field . getName ( ) ; Object o = fieldsMap . get ( fieldName , null ) ; Field [ ] args ; if ( o == null ) { args = new Field [ 1 ] ; fieldsMap . setEL ( fieldName , args ) ; } else { Field [ ] fs = ( Field [ ] ) o ; args = new Field [ fs . length + 1 ] ; for ( int i = 0 ; i < fs . length ; i ++ ) { f...
public class Section { /** * Adds a < CODE > Paragraph < / CODE > , < CODE > List < / CODE > or < CODE > Table < / CODE > * to this < CODE > Section < / CODE > . * @ paramindexindex at which the specified element is to be inserted * @ paramo an object of type < CODE > Paragraph < / CODE > , < CODE > List < / CODE...
if ( isAddedCompletely ( ) ) { throw new IllegalStateException ( "This LargeElement has already been added to the Document." ) ; } try { Element element = ( Element ) o ; if ( element . isNestable ( ) ) { super . add ( index , element ) ; } else { throw new ClassCastException ( "You can't add a " + element . getClass (...
public class OptionsBuilder { /** * Allow an application that want to share { @ link AsyncHttpClient } or configure it before it gets used * by the library . * @ param client * @ param runtimeShared to true if the runtime is shared between clients . If shared , the asyncHttpClient . close ( ) * must be invoked ...
this . client = client ; this . runtimeShared = runtimeShared ; return derived . cast ( this ) ;
public class Pipes { /** * Extact one value from the selected pipe or an zero Maybe if it doesn ' t exist . Currently only Adapter ' s and not Publishers * are managed by Pipes so Publisher errors are not propagated ( @ see { @ link Pipes # oneValue ( Object ) } or @ see { @ link Pipes # oneOrError ( Object ) } is be...
final ValueSubscriber < V > sub = ValueSubscriber . subscriber ( ) ; return get ( key ) . peek ( a -> a . stream ( ) . subscribe ( sub ) ) . map ( a -> sub . toTry ( classes ) ) ;
public class BobblePath { /** * Update the position of the pathable or return false if it ' s already there . */ protected boolean updatePositionTo ( Pathable pable , int x , int y ) { } }
if ( ( pable . getX ( ) == x ) && ( pable . getY ( ) == y ) ) { return false ; } else { pable . setLocation ( x , y ) ; return true ; }
public class RegisteredCommand { /** * path nodes are query parameters . Either node can be empty , but not null . */ private static int compareNodes ( String node1 , String node2 ) { } }
assert node1 != null ; assert node2 != null ; if ( node1 . equals ( node2 ) ) { return 0 ; } if ( node1 . length ( ) > 0 && node1 . charAt ( 0 ) == '{' ) { if ( node2 . length ( ) > 0 && node2 . charAt ( 0 ) == '{' ) { return 0 ; // Both nodes are parameters ; names are irrelevant } return 1 ; // r1 is a parameter but ...
public class Zone { /** * Adds an RRset to the Zone * @ param rrset The RRset to be added * @ see RRset */ public void addRRset ( RRset rrset ) { } }
Name name = rrset . getName ( ) ; addRRset ( name , rrset ) ;
public class PDTXMLConverter { /** * Get the passed { @ link XMLGregorianCalendar } as { @ link LocalTime } . * @ param aCal * The source { @ link XMLGregorianCalendar } . May be < code > null < / code > . * @ return < code > null < / code > if the parameter is < code > null < / code > . */ @ Nullable public stat...
if ( aCal == null ) return null ; return getGregorianCalendar ( aCal ) . toZonedDateTime ( ) . toLocalTime ( ) ;
public class SimulatorEngine { /** * Called when a job is completed . Insert a { @ link JobCompleteEvent } into the * { @ link SimulatorEventQueue } . This event will be picked up by * { @ link SimulatorJobClient } , which will in turn decide whether the * simulation is done . * @ param jobStatus final status o...
queue . add ( new JobCompleteEvent ( jc , timestamp , jobStatus , this ) ) ;
public class GolangGenerator { /** * All we need is the imports , type declaration , and encode / decode */ public void generateMessageHeaderStub ( ) throws IOException { } }
final String messageHeader = "MessageHeader" ; try ( Writer out = outputManager . createOutput ( messageHeader ) ) { final StringBuilder sb = new StringBuilder ( ) ; final List < Token > tokens = ir . headerStructure ( ) . tokens ( ) ; imports = new TreeSet < > ( ) ; imports . add ( "io" ) ; generateTypeDeclaration ( s...
public class Parsys { /** * Get resource type for new area - from current parsys component or from a supertype component . * @ param componentPath Component path * @ return Resource type ( never null ) */ private String getNewAreaResourceType ( String componentPath ) { } }
Resource componentResource = resolver . getResource ( componentPath ) ; if ( componentResource != null ) { if ( componentResource . getChild ( NEWAREA_CHILD_NAME ) != null ) { return componentPath + "/" + NEWAREA_CHILD_NAME ; } String resourceSuperType = componentResource . getResourceSuperType ( ) ; if ( StringUtils ....