signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BindTypeBuilder { /** * Generate serialize on xml . * @ param context * the context * @ param entity * the entity */ private static void generateSerializeOnXml ( BindTypeContext context , BindEntity entity ) { } }
// @ formatter : off MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "serializeOnXml" ) . addJavadoc ( "method for xml serialization\n" ) . addAnnotation ( Override . class ) . addModifiers ( Modifier . PUBLIC ) // . addParameter ( typeName ( KriptonXmlContext . class ) , " context " ) . addParameter ...
public class SGraphSegment { /** * Disconnect the begin point of this segment . */ public void disconnectBegin ( ) { } }
if ( this . startPoint != null ) { this . startPoint . remove ( this ) ; } this . startPoint = new SGraphPoint ( getGraph ( ) ) ; this . startPoint . add ( this ) ;
public class WebhookManager { /** * Mostly debug method . Logs hook manipulation result * @ param format prepended comment for log * @ return always true predicate */ protected Predicate < GHHook > log ( final String format ) { } }
return new NullSafePredicate < GHHook > ( ) { @ Override protected boolean applyNullSafe ( @ Nonnull GHHook input ) { LOGGER . debug ( format ( "%s {} (events: {})" , format ) , input . getUrl ( ) , input . getEvents ( ) ) ; return true ; } } ;
public class Matrix4f { /** * Set this matrix to be an arbitrary perspective projection frustum transformation for a left - handed coordinate system * using OpenGL ' s NDC z range of < code > [ - 1 . . + 1 ] < / code > . * In order to apply the perspective frustum transformation to an existing transformation , * ...
if ( ( properties & PROPERTY_IDENTITY ) == 0 ) MemUtil . INSTANCE . identity ( this ) ; this . _m00 ( ( zNear + zNear ) / ( right - left ) ) ; this . _m11 ( ( zNear + zNear ) / ( top - bottom ) ) ; this . _m20 ( ( right + left ) / ( right - left ) ) ; this . _m21 ( ( top + bottom ) / ( top - bottom ) ) ; boolean farInf...
public class UserResources { /** * Returns redirectURI based on whether this user has previously accepted the authorization page * @ param req The Http Request with authorization header * @ return Returns either redirectURI or OauthException */ @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "/check_oaut...
String userName = findUserByToken ( req ) ; int result = authService . countByUserId ( userName ) ; OAuthAcceptResponseDto responseDto = new OAuthAcceptResponseDto ( ) ; if ( result == 0 ) { throw new OAuthException ( ResponseCodes . ERR_FINDING_USERNAME , HttpResponseStatus . BAD_REQUEST ) ; } else { responseDto . set...
public class JnlpFileScreen { /** * Add button ( s ) to the toolbar . */ public void addToolbarButtons ( ToolScreen toolScreen ) { } }
new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , JnlpFileScreen . WRITE_FILE , MenuConstants . PRINT , JnlpFileScreen . WRITE_FILE , null ) ;
public class LuceneIndexer { /** * Updates document . * @ param metadata * the metadata * @ param entity * the object * @ param parentId * the parent id * @ param clazz * the clazz * @ return the document */ private void updateDocument ( EntityMetadata metadata , final MetamodelImpl metaModel , Object...
updateOrCreateIndex ( metadata , metaModel , entity , parentId , entity . getClass ( ) , true ) ; onCommit ( ) ;
public class Polyline { /** * default behaviour when no click listener is set */ public boolean onClickDefault ( Polyline polyline , MapView mapView , GeoPoint eventPos ) { } }
polyline . setInfoWindowLocation ( eventPos ) ; polyline . showInfoWindow ( ) ; return true ;
public class Curve25519 { /** * / * Check if reduced - form input > = 2 ^ 255-19 */ private static final boolean is_overflow ( long10 x ) { } }
return ( ( ( x . _0 > P26 - 19 ) ) && ( ( x . _1 & x . _3 & x . _5 & x . _7 & x . _9 ) == P25 ) && ( ( x . _2 & x . _4 & x . _6 & x . _8 ) == P26 ) ) || ( x . _9 > P25 ) ;
public class AnimatedDrawable2 { /** * Stop the animation at the current frame . It can be resumed by calling { @ link # start ( ) } again . */ @ Override public void stop ( ) { } }
if ( ! mIsRunning ) { return ; } mIsRunning = false ; mStartTimeMs = 0 ; mExpectedRenderTimeMs = mStartTimeMs ; mLastFrameAnimationTimeMs = - 1 ; mLastDrawnFrameNumber = - 1 ; unscheduleSelf ( mInvalidateRunnable ) ; mAnimationListener . onAnimationStop ( this ) ;
public class ReflectCache { /** * 往缓存里放入方法 * @ param serviceName 服务名 ( 非接口名 ) * @ param method 方法 */ public static void putMethodCache ( String serviceName , Method method ) { } }
ConcurrentHashMap < String , Method > cache = NOT_OVERLOAD_METHOD_CACHE . get ( serviceName ) ; if ( cache == null ) { cache = new ConcurrentHashMap < String , Method > ( ) ; ConcurrentHashMap < String , Method > old = NOT_OVERLOAD_METHOD_CACHE . putIfAbsent ( serviceName , cache ) ; if ( old != null ) { cache = old ; ...
public class Key { /** * Returns raw class of associated type * @ return raw class */ public Class < T > rawClass ( ) { } }
Type type = type ( ) ; if ( type instanceof Class ) { return ( Class ) type ; } else if ( type instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) type ; return ( Class ) pType . getRawType ( ) ; } else { throw new UnsupportedOperationException ( type + " " + type . getClass ( ) . getName (...
public class chemicalStructureImpl { /** * - - - - - CANONICAL METHODS - - - - - */ public int equivalenceCode ( ) { } }
int result = 29 + ( STRUCTURE_FORMAT != null ? STRUCTURE_FORMAT . hashCode ( ) : 0 ) ; result = 29 * result + ( STRUCTURE_DATA != null ? STRUCTURE_DATA . hashCode ( ) : 0 ) ; return result ;
public class HttpUtils { /** * Execute http response . * @ param url the url * @ param method the method * @ param headers the headers * @ return the http response */ public static HttpResponse execute ( final String url , final String method , final Map < String , Object > headers ) { } }
return execute ( url , method , null , null , new HashMap < > ( ) , headers ) ;
public class AdminToolUtils { /** * Utility function that fetches system store definitions * @ return The map container that maps store names to store definitions */ public static Map < String , StoreDefinition > getSystemStoreDefMap ( ) { } }
Map < String , StoreDefinition > sysStoreDefMap = Maps . newHashMap ( ) ; List < StoreDefinition > storesDefs = SystemStoreConstants . getAllSystemStoreDefs ( ) ; for ( StoreDefinition def : storesDefs ) { sysStoreDefMap . put ( def . getName ( ) , def ) ; } return sysStoreDefMap ;
public class Histogram { /** * Prints a bucket of this histogram in a human readable ASCII format . * @ param out The buffer to which to write the output . * @ see # printAscii */ final void printAsciiBucket ( final StringBuilder out , final int i ) { } }
out . append ( '[' ) . append ( bucketLowInterval ( i ) ) . append ( '-' ) . append ( i == buckets . length - 1 ? "Inf" : bucketHighInterval ( i ) ) . append ( "): " ) . append ( buckets [ i ] ) . append ( '\n' ) ;
public class LogcatWriter { /** * Clears an existing string builder or creates a new one if given string builder is { @ code null } . * @ param builder * String builder instance or { @ code null } * @ param capacity * Initial capacity for new string builder if created * @ return Empty string builder */ privat...
if ( builder == null ) { return new StringBuilder ( capacity ) ; } else { builder . setLength ( 0 ) ; return builder ; }
public class CryptoServiceSingleton { /** * Build an hexadecimal MD5 hash for a String . * @ param value The String to hash * @ return An hexadecimal Hash */ @ Override public String hexMD5 ( String value ) { } }
return String . valueOf ( Hex . encodeHex ( md5 ( value ) ) ) ;
public class ApplicationGatewaysInner { /** * Lists all application gateways in a resource group . * @ param resourceGroupName The name of the resource group . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ApplicationGatewayInner & g...
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < ApplicationGatewayInner > > , Page < ApplicationGatewayInner > > ( ) { @ Override public Page < ApplicationGatewayInner > call ( ServiceResponse < Page < ApplicationGatewayInner > > response ) { return ...
public class FilePath { /** * Returns the native path . */ @ Override public String getNativePath ( ) { } }
if ( ! isWindows ( ) ) { return getFullPath ( ) ; } String path = getFullPath ( ) ; int length = path . length ( ) ; CharBuffer cb = new CharBuffer ( ) ; char ch ; int offset = 0 ; // For windows , convert / c : to c : if ( length >= 3 && path . charAt ( 0 ) == '/' && path . charAt ( 2 ) == ':' && ( 'a' <= ( ch = path ...
public class DefaultProcessDiagramCanvas { /** * This method returns intersection point of shape border and line . * @ param shape * @ param line * @ return Point */ private static Point getIntersection ( Shape shape , Line2D . Double line ) { } }
if ( shape instanceof Ellipse2D ) { return getEllipseIntersection ( shape , line ) ; } else if ( shape instanceof Rectangle2D || shape instanceof Path2D ) { return getShapeIntersection ( shape , line ) ; } else { // something strange return null ; }
public class AWSRoboMakerClient { /** * Returns a list of robot application . You can optionally provide filters to retrieve specific robot applications . * @ param listRobotApplicationsRequest * @ return Result of the ListRobotApplications operation returned by the service . * @ throws InvalidParameterException ...
request = beforeClientExecution ( request ) ; return executeListRobotApplications ( request ) ;
public class WFGHypervolume { /** * Updates the reference point */ private void updateReferencePoint ( Front front ) { } }
double [ ] maxObjectives = new double [ numberOfObjectives ] ; for ( int i = 0 ; i < numberOfObjectives ; i ++ ) { maxObjectives [ i ] = 0 ; } for ( int i = 0 ; i < front . getNumberOfPoints ( ) ; i ++ ) { for ( int j = 0 ; j < numberOfObjectives ; j ++ ) { if ( maxObjectives [ j ] < front . getPoint ( i ) . getValue (...
public class CreateProcedureAsSQL { /** * Check whether or not a procedure name is acceptible . * @ param identifier the identifier to check * @ param statement the statement where the identifier is * @ return the given identifier unmodified * @ throws VoltCompilerException */ private String checkProcedureIdent...
String retIdent = checkIdentifierStart ( identifier , statement ) ; if ( retIdent . contains ( "." ) ) { String msg = String . format ( "Invalid procedure name containing dots \"%s\" in DDL: \"%s\"" , identifier , statement . substring ( 0 , statement . length ( ) - 1 ) ) ; throw m_compiler . new VoltCompilerException ...
public class DialogImpl { /** * Adding the new incoming invokeId into incomingInvokeList list * @ param invokeId * @ return false : failure - this invokeId already present in the list */ private boolean addIncomingInvokeId ( Long invokeId ) { } }
synchronized ( this . incomingInvokeList ) { if ( this . incomingInvokeList . contains ( invokeId ) ) return false ; else { this . incomingInvokeList . add ( invokeId ) ; return true ; } }
public class SavedRequestAwareProcessor { /** * Checks if there ' s a request in the request cache ( which means that a previous request was cached ) . If there ' s * one , the request cache creates a new request by merging the saved request with the current request . The new * request is used through the rest of t...
HttpServletRequest request = context . getRequest ( ) ; HttpServletResponse response = context . getResponse ( ) ; HttpServletRequest wrappedSavedRequest = requestCache . getMatchingRequest ( request , response ) ; if ( wrappedSavedRequest != null ) { logger . debug ( "A previously saved request was found, and has been...
public class DamerauLevenshtein { /** * Convenience method for calling { @ link # damerauLevenshteinDistance ( String str1 , String str2 ) } * when you don ' t care about case sensitivity . * @ param str1 First string being compared * @ param str2 Second string being compared * @ return Case - insensitive edit ...
return damerauLevenshteinDistance ( str1 . toLowerCase ( ) , str2 . toLowerCase ( ) ) ;
public class BandwidthClient { /** * Helper method that builds the request to the server . * Only POST is supported currently since we have cases in the API * like token creation that accepts empty string payload " " , instead of { } * @ param method the method . * @ param path the path . * @ param params jso...
if ( StringUtils . equalsIgnoreCase ( method , HttpPost . METHOD_NAME ) ) { return generatePostRequest ( path , params ) ; } else { throw new RuntimeException ( String . format ( "Method %s not supported." , method ) ) ; }
public class SingleBusLocatorRegistrar { /** * Is the transport secured by a JAX - WS property */ private boolean isSecuredByProperty ( Server server ) { } }
boolean isSecured = false ; Object value = server . getEndpoint ( ) . get ( "org.talend.tesb.endpoint.secured" ) ; // Property name TBD if ( value instanceof String ) { try { isSecured = Boolean . valueOf ( ( String ) value ) ; } catch ( Exception ex ) { } } return isSecured ;
public class ProjectApi { /** * Get a Pager instance of projects accessible by the authenticated user . * < pre > < code > GET / projects < / code > < / pre > * @ param itemsPerPage the number of Project instances that will be fetched per page * @ return a Pager instance of projects accessible by the authenticate...
return ( new Pager < Project > ( this , Project . class , itemsPerPage , null , "projects" ) ) ;
public class LogicSchema { /** * Renew data source configuration . * @ param dataSourceChangedEvent data source changed event . * @ throws Exception exception */ @ Subscribe public final synchronized void renew ( final DataSourceChangedEvent dataSourceChangedEvent ) throws Exception { } }
if ( ! name . equals ( dataSourceChangedEvent . getShardingSchemaName ( ) ) ) { return ; } backendDataSource . close ( ) ; dataSources . clear ( ) ; dataSources . putAll ( DataSourceConverter . getDataSourceParameterMap ( dataSourceChangedEvent . getDataSourceConfigurations ( ) ) ) ; backendDataSource = new JDBCBackend...
public class MQLinkMessageItemStream { /** * Link specific warning message * ( 510343) */ protected void issueDepthIntervalMessage ( long depth ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "issueDepthIntervalMessage" , new Long ( depth ) ) ; // {0 } messages queued for transmission from messaging engine { 1 } to foreign bus { 2 } on link { 3 } . SibTr . info ( tc , "REMOTE_LINK_DESTINATION_DEPTH_INTERVAL_REACH...
public class LookupService { /** * Returns the country the IP address is in . * @ param ipAddress * the IP address in long format . * @ return the country the IP address is from . */ public synchronized Country getCountry ( long ipAddress ) { } }
if ( file == null && ( dboptions & GEOIP_MEMORY_CACHE ) == 0 ) { throw new IllegalStateException ( "Database has been closed." ) ; } int ret = seekCountry ( ipAddress ) - COUNTRY_BEGIN ; if ( ret == 0 ) { return UNKNOWN_COUNTRY ; } else { return new Country ( countryCode [ ret ] , countryName [ ret ] ) ; }
public class ArcSort { /** * Applies the ArcSort on the provided fst . Sorting can be applied either on input or output label based on the * provided comparator . * @ param fst the fst to sort it ' s arcs * @ param comparator the provided Comparator */ public static void sortBy ( MutableFst fst , Comparator < Arc...
int numStates = fst . getStateCount ( ) ; for ( int i = 0 ; i < numStates ; i ++ ) { MutableState s = fst . getState ( i ) ; s . arcSort ( comparator ) ; }
public class AggregatorModelV99 { /** * Version & Schema - specific filling into the impl */ @ Override public AggregatorModel createImpl ( ) { } }
AggregatorModel . AggregatorParameters parms = parameters . createImpl ( ) ; return new AggregatorModel ( model_id . key ( ) , parms , null ) ;
public class GeneratorSingleCluster { /** * Apply a rotation to the generator * @ param axis1 First axis ( 0 & lt ; = axis1 & lt ; dim ) * @ param axis2 Second axis ( 0 & lt ; = axis2 & lt ; dim ) * @ param angle Angle in Radians */ public void addRotation ( int axis1 , int axis2 , double angle ) { } }
if ( trans == null ) { trans = new AffineTransformation ( dim ) ; } trans . addRotation ( axis1 , axis2 , angle ) ;
public class MeasureFormat { /** * Create a format from the locale , formatWidth , and format . * @ param locale the locale . * @ param formatWidth hints how long formatted strings should be . * @ param format This is defensively copied . * @ return The new MeasureFormat object . */ public static MeasureFormat ...
PluralRules rules = PluralRules . forLocale ( locale ) ; NumericFormatters formatters = null ; MeasureFormatData data = localeMeasureFormatData . get ( locale ) ; if ( data == null ) { data = loadLocaleData ( locale ) ; localeMeasureFormatData . put ( locale , data ) ; } if ( formatWidth == FormatWidth . NUMERIC ) { fo...
public class VoiceApi { /** * Initiate a transfer * Initiate a two - step transfer by placing the first call on hold and dialing the destination number ( step 1 ) . After initiating the transfer , you can use [ / voice / calls / { id } / complete - transfer ] ( / reference / workspace / Voice / index . html # complet...
ApiResponse < ApiSuccessResponse > resp = initiateTransferWithHttpInfo ( id , initiateTransferData ) ; return resp . getData ( ) ;
public class GetBotAliasesResult { /** * An array of < code > BotAliasMetadata < / code > objects , each describing a bot alias . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBotAliases ( java . util . Collection ) } or { @ link # withBotAliases ( java ...
if ( this . botAliases == null ) { setBotAliases ( new java . util . ArrayList < BotAliasMetadata > ( botAliases . length ) ) ; } for ( BotAliasMetadata ele : botAliases ) { this . botAliases . add ( ele ) ; } return this ;
public class SqlHelper { /** * 判断自动 ! = null的条件结构 * @ param column * @ param contents * @ param empty * @ return */ public static String getIfNotNull ( EntityColumn column , String contents , boolean empty ) { } }
return getIfNotNull ( null , column , contents , empty ) ;
public class S3ClientCache { /** * Returns a { @ link TransferManager } for the given region , or throws an * exception when unable . The returned { @ link TransferManager } will always * be instantiated from whatever { @ link AmazonS3 } is in the cache , * whether provided with { @ link # useClient ( AmazonS3 ) ...
synchronized ( transferManagersByRegion ) { TransferManager tm = transferManagersByRegion . get ( region ) ; if ( tm == null ) { tm = new TransferManager ( getClient ( region ) ) ; transferManagersByRegion . put ( region , tm ) ; } return tm ; }
public class AppServiceEnvironmentsInner { /** * Get diagnostic information for an App Service Environment . * Get diagnostic information for an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . *...
return listDiagnosticsWithServiceResponseAsync ( resourceGroupName , name ) . map ( new Func1 < ServiceResponse < List < HostingEnvironmentDiagnosticsInner > > , List < HostingEnvironmentDiagnosticsInner > > ( ) { @ Override public List < HostingEnvironmentDiagnosticsInner > call ( ServiceResponse < List < HostingEnvir...
public class HTTPUtil { /** * public static ContentType getContentType ( HttpMethod http ) { Header [ ] headers = * http . getResponseHeaders ( ) ; for ( int i = 0 ; i < headers . length ; i + + ) { * if ( " Content - Type " . equalsIgnoreCase ( headers [ i ] . getName ( ) ) ) { String [ ] mimeCharset = * splitMi...
// return lucee . commons . net . HTTPUtil . toURI ( strUrl , port ) ; Map < String , String > data = new HashMap < String , String > ( ) ; StringList list = ListUtil . toList ( _str , '&' ) ; String str ; int index ; while ( list . hasNext ( ) ) { str = list . next ( ) ; index = str . indexOf ( '=' ) ; if ( index == -...
public class Main { /** * HeaderKey1 : value1 | HeaderKey2 : value2 . . . * @ param value * @ return */ private static Map < String , String > extractHeaders ( String value ) { } }
if ( value == null ) return null ; return Splitter . on ( "|" ) . withKeyValueSeparator ( ":" ) . split ( value ) ;
public class LunarCalendar { /** * 获取今天的农历日期 * @ return 今天的农历日期数组 , 数组第一个元素是年 , 第二个元素是月 , 第三个元素是日 */ public static int [ ] today ( ) { } }
Calendar today = Calendar . getInstance ( ) ; int year = today . get ( Calendar . YEAR ) ; int month = today . get ( Calendar . MONTH ) + 1 ; int date = today . get ( Calendar . DATE ) ; return calElement ( year , month , date ) ;
public class BundleUtils { /** * Returns a optional int array value . In other words , returns the value mapped by key if it exists and is a int array . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . * @ param bundle a bundle . If the bundle is null , thi...
if ( bundle == null ) { return fallback ; } return bundle . getIntArray ( key ) ;
public class VTimeZone { /** * Write the time zone rules in RFC2445 VTIMEZONE format */ private void writeZone ( Writer w , BasicTimeZone basictz , String [ ] customProperties ) throws IOException { } }
// Write the header writeHeader ( w ) ; if ( customProperties != null && customProperties . length > 0 ) { for ( int i = 0 ; i < customProperties . length ; i ++ ) { if ( customProperties [ i ] != null ) { w . write ( customProperties [ i ] ) ; w . write ( NEWLINE ) ; } } } long t = MIN_TIME ; String dstName = null ; i...
public class ChunkFetcherBase { /** * Fetch existing domain objects based on natural keys * @ param keys * Set of natural keys for the domain objects to fetch * @ param resultAsSet * indicates if the keys are unique or not , eg . the resulting map * must be a set of objects . * @ return Map with keys and do...
// it is not " possible " to use huge number of parameters in a // Restrictions . in criterion and therefore we chunk the query // into pieces List < T > all = new ArrayList < T > ( ) ; Iterator < ? extends KEY > iter = keys . iterator ( ) ; List < KEY > chunkKeys = new ArrayList < KEY > ( ) ; for ( int i = 1 ; iter . ...
public class Form { /** * Sets a new int value to a given form ' s field . The field whose variable matches the * requested variable will be completed with the specified value . If no field could be found * for the specified variable then an exception will be raised . * @ param variable the variable name that was...
FormField field = getField ( variable ) ; if ( field == null ) { throw new IllegalArgumentException ( "Field not found for the specified variable name." ) ; } validateThatFieldIsText ( field ) ; setAnswer ( field , value ) ;
public class BufferedElementReader { /** * Reads an element at a specific position . * < p > This method does not influence the order in which the elements * are read by { @ link # readElement ( ) } . < / p > * < p > The execution time of this method can be in the order of * { @ code O ( index ) } in the worst ...
if ( index < 0 ) { throw new IndexOutOfBoundsException ( "Index is negative." ) ; } if ( closed ) { throw new IllegalStateException ( "Reader is closed." ) ; } while ( index >= buffer . size ( ) ) { Element element = reader . readElement ( ) ; if ( element == null ) { throw new IndexOutOfBoundsException ( "Index is lar...
public class ShadedNettyGrpcServerFactory { /** * Converts the given client auth option to netty ' s client auth . * @ param clientAuth The client auth option to convert . * @ return The converted client auth option . */ protected static io . grpc . netty . shaded . io . netty . handler . ssl . ClientAuth of ( fina...
switch ( clientAuth ) { case NONE : return io . grpc . netty . shaded . io . netty . handler . ssl . ClientAuth . NONE ; case OPTIONAL : return io . grpc . netty . shaded . io . netty . handler . ssl . ClientAuth . OPTIONAL ; case REQUIRE : return io . grpc . netty . shaded . io . netty . handler . ssl . ClientAuth . R...
public class MavenRepositorySystem { /** * Resolves artifact dependencies . * The { @ link ArtifactResult } contains a reference to a file in Maven local repository . * @ param repoSession The current Maven session * @ param swrSession SWR Aether session abstraction * @ param request The request to be computed ...
final DependencyRequest depRequest = new DependencyRequest ( request , new MavenResolutionFilterWrap ( filters , Collections . unmodifiableList ( new ArrayList < MavenDependency > ( swrSession . getDependenciesForResolution ( ) ) ) ) ) ; DependencyResult result = system . resolveDependencies ( repoSession , depRequest ...
public class AbstractRowPlotter { /** * Check if the point ( x , y ) is contained in the chart area * We check only minX , maxX , and maxY to avoid flickering . * We take max ( chartRect . y , y ) as redering value * This is done to prevent line out of range if new point is added * during chart paint . */ prote...
boolean ret = true ; // check x if ( xx < chartRect . x || xx > chartRect . x + chartRect . width ) { ret = false ; } else // check y bellow x axis if ( yy > chartRect . y + chartRect . height ) { ret = false ; } return ret ;
public class AbstractCIBase { /** * Updates Computers . * This method tries to reuse existing { @ link Computer } objects * so that we won ' t upset { @ link Executor } s running in it . */ protected void updateComputerList ( final boolean automaticSlaveLaunch ) { } }
final Map < Node , Computer > computers = getComputerMap ( ) ; final Set < Computer > old = new HashSet < Computer > ( computers . size ( ) ) ; Queue . withLock ( new Runnable ( ) { @ Override public void run ( ) { Map < String , Computer > byName = new HashMap < String , Computer > ( ) ; for ( Computer c : computers ....
public class PythonHelper { /** * Executes a python script and return its output . * @ param fileName the filename of the python script to execute * @ param arguments the arguments to pass to the python script * @ return the output of the python script execution ( combined standard and error outputs ) * @ throw...
return execute ( fileName , true , arguments ) ;
public class UserConnection { /** * { @ inheritDoc } */ @ Override public TResult rawQuery ( String sql , String [ ] selectionArgs ) { } }
ResultSet resultSet = SQLUtils . query ( connection , sql , selectionArgs ) ; int count = SQLUtils . count ( connection , sql , selectionArgs ) ; return createResult ( resultSet , count ) ;
public class Yylex { /** * Resumes scanning until the next regular expression is matched , * the end of input is encountered or an I / O - Error occurs . * @ return the next token * @ exception java . io . IOException if any I / O - Error occurs */ public Yytoken yylex ( ) throws java . io . IOException , ParseEx...
int zzInput ; int zzAction ; // cached fields : int zzCurrentPosL ; int zzMarkedPosL ; int zzEndReadL = zzEndRead ; char [ ] zzBufferL = zzBuffer ; char [ ] zzCMapL = ZZ_CMAP ; int [ ] zzTransL = ZZ_TRANS ; int [ ] zzRowMapL = ZZ_ROWMAP ; int [ ] zzAttrL = ZZ_ATTRIBUTE ; while ( true ) { zzMarkedPosL = zzMarkedPos ; yy...
public class ComponentCommander { /** * Finds all popups . A Component is a popup if it ' s a DialogPane , modal and not resizable . * @ return the list of all found popups . */ protected static List < Stage > findPopups ( ) throws QTasteTestFailException { } }
// find all popups List < Stage > popupFound = new ArrayList < > ( ) ; for ( Stage stage : getStages ( ) ) { Parent root = stage . getScene ( ) . getRoot ( ) ; if ( isAPopup ( stage ) ) { // it ' s maybe a popup . . . a popup is modal and not resizable and has a DialogPane root DialogPane dialog = ( DialogPane ) root ;...
public class Searcher { /** * Adds a facet refinement for the next queries . * < b > This method resets the current page to 0 . < / b > * @ param attribute the attribute to refine on . * @ param value the facet ' s value to refine with . * @ return this { @ link Searcher } for chaining . */ @ NonNull @ Suppress...
"WeakerAccess" , "unused" } ) // For library users public Searcher addFacetRefinement ( @ NonNull String attribute , @ NonNull String value ) { return addFacetRefinement ( attribute , Collections . singletonList ( value ) , disjunctiveFacets . contains ( attribute ) ) ;
public class AdditionalRequestHeadersInterceptor { /** * Adds the given header value . * Note that { @ code headerName } and { @ code headerValue } cannot be null . * @ param headerName the name of the header * @ param headerValue the value to add for the header * @ throws NullPointerException if either paramet...
Objects . requireNonNull ( headerName , "headerName cannot be null" ) ; Objects . requireNonNull ( headerValue , "headerValue cannot be null" ) ; getHeaderValues ( headerName ) . add ( headerValue ) ;
public class SoundStore { /** * Set the stream being played * @ param stream The stream being streamed */ void setStream ( OpenALStreamPlayer stream ) { } }
if ( ! soundWorks ) { return ; } currentMusic = sources . get ( 0 ) ; this . stream = stream ; if ( stream != null ) { this . mod = null ; } paused = false ;
public class ListViewCompat { /** * Find a position that can be selected ( i . e . , is not a separator ) . * @ param position The starting position to look at . * @ param lookDown Whether to look down for other positions . * @ return The next selectable position starting at position and then searching either up ...
final ListAdapter adapter = getAdapter ( ) ; if ( adapter == null || isInTouchMode ( ) ) { return INVALID_POSITION ; } final int count = adapter . getCount ( ) ; if ( ! getAdapter ( ) . areAllItemsEnabled ( ) ) { if ( lookDown ) { position = Math . max ( 0 , position ) ; while ( position < count && ! adapter . isEnable...
public class ExportTaskMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ExportTask exportTask , ProtocolMarshaller protocolMarshaller ) { } }
if ( exportTask == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( exportTask . getTaskId ( ) , TASKID_BINDING ) ; protocolMarshaller . marshall ( exportTask . getTaskName ( ) , TASKNAME_BINDING ) ; protocolMarshaller . marshall ( exportTask...
public class InvokeDynamicFieldAccess { /** * Get a new instance that can access the given Field * @ param classAccess The InvokeDynamicClassAccess instance to be delegated to * @ param f Field to be accessed * @ param < C > The type of class being accessed * @ return New InvokeDynamicFieldAccess instance */ pu...
return new InvokeDynamicFieldAccess < C > ( classAccess , f ) ;
public class DefaultSentryClientFactory { /** * Maximum time to wait for { @ link BufferedConnection } shutdown when closed , in milliseconds . * @ param dsn Sentry server DSN which may contain options . * @ return Maximum time to wait for { @ link BufferedConnection } shutdown when closed , in milliseconds . */ pr...
return Util . parseLong ( Lookup . lookup ( BUFFER_SHUTDOWN_TIMEOUT_OPTION , dsn ) , BUFFER_SHUTDOWN_TIMEOUT_DEFAULT ) ;
public class NativeGlobal { /** * The global unescape method , as per ECMA - 262 15.1.2.5. */ private Object js_unescape ( Object [ ] args ) { } }
String s = ScriptRuntime . toString ( args , 0 ) ; int firstEscapePos = s . indexOf ( '%' ) ; if ( firstEscapePos >= 0 ) { int L = s . length ( ) ; char [ ] buf = s . toCharArray ( ) ; int destination = firstEscapePos ; for ( int k = firstEscapePos ; k != L ; ) { char c = buf [ k ] ; ++ k ; if ( c == '%' && k != L ) { ...
public class ParallelTaskBuilder { /** * Sets the response context . * @ param responseContext * the response context * @ return the parallel task builder */ public ParallelTaskBuilder setResponseContext ( Map < String , Object > responseContext ) { } }
if ( responseContext != null ) this . responseContext = responseContext ; else logger . error ( "context cannot be null. skip set." ) ; return this ;
public class D6CrudHelperBase { /** * get primary key field of model class * @ return */ final List < Field > getPrimaryKeyFieldList ( ) { } }
final List < Field > fieldList = new ArrayList < Field > ( ) ; final Set < String > columnNameSet = getAllColumnNames ( ) ; for ( String columnName : columnNameSet ) { final D6ModelClassFieldInfo fieldInfo = getFieldInfo ( columnName ) ; final Field field = fieldInfo . field ; final DBColumn dbColumn = field . getAnnot...
public class SynchronizedStatesManager { /** * Track state machine membership . If it changes , notify all state machine instances */ private void checkForMembershipChanges ( ) throws KeeperException , InterruptedException { } }
Set < String > children = ImmutableSet . copyOf ( m_zk . getChildren ( m_stateMachineMemberPath , m_membershipWatcher ) ) ; Set < String > removedMembers ; Set < String > addedMembers ; if ( m_registeredStateMachineInstances == m_registeredStateMachines . length && ! m_groupMembers . equals ( children ) ) { removedMemb...
public class HINFormat { /** * { @ inheritDoc } */ @ Override public boolean matches ( int lineNumber , String line ) { } }
if ( line . startsWith ( "atom " ) && ( line . endsWith ( " s" ) || line . endsWith ( " d" ) || line . endsWith ( " t" ) || line . endsWith ( " a" ) ) ) { StringTokenizer tokenizer = new StringTokenizer ( line , " " ) ; if ( ( tokenizer . countTokens ( ) % 2 ) == 0 ) { // odd number of values found , typical for HIN re...
public class DerIndefLenConverter { /** * Parse the tag and if it is an end - of - contents tag then * add the current position to the < code > eocList < / code > vector . */ private void parseTag ( ) throws IOException { } }
if ( dataPos == dataSize ) return ; if ( isEOC ( data [ dataPos ] ) && ( data [ dataPos + 1 ] == 0 ) ) { int numOfEncapsulatedLenBytes = 0 ; Object elem = null ; int index ; for ( index = ndefsList . size ( ) - 1 ; index >= 0 ; index -- ) { // Determine the first element in the vector that does not // have a matching E...
public class RemoteBundleContextImpl { /** * { @ inheritDoc } */ public void setBundleStartLevel ( long bundleId , int startLevel ) throws RemoteException , BundleException { } }
try { final StartLevel startLevelService = getService ( StartLevel . class , 0 ) ; startLevelService . setBundleStartLevel ( m_bundleContext . getBundle ( bundleId ) , startLevel ) ; } catch ( NoSuchServiceException e ) { throw new BundleException ( "Cannot get the start level service to set bundle start level" ) ; }
public class RecoverableMultiPartUploadImpl { @ VisibleForTesting static String createIncompletePartObjectNamePrefix ( String objectName ) { } }
checkNotNull ( objectName ) ; final int lastSlash = objectName . lastIndexOf ( '/' ) ; final String parent ; final String child ; if ( lastSlash == - 1 ) { parent = "" ; child = objectName ; } else { parent = objectName . substring ( 0 , lastSlash + 1 ) ; child = objectName . substring ( lastSlash + 1 ) ; } return pare...
public class UCSReader { /** * Read a single character . This method will block until a character is available , an I / O error * occurs , or the end of the stream is reached . * < p > If supplementary Unicode character is encountered in < code > UCS - 4 < / code > input , it will be * encoded into < code > UTF -...
// If we got something in the char buffer , let ' s use it . if ( 0 != fCharCount ) { fCharCount -- ; return ( ( int ) fCharBuf [ fCharCount ] ) & 0xFFFF ; } int b0 = fInputStream . read ( ) & 0xff ; // 1st byte if ( b0 == 0xff ) { return - 1 ; } int b1 = fInputStream . read ( ) & 0xff ; // 2nd byte if ( b1 == 0xff ) {...
public class ObjectMarshallingStrategyStoreImpl { /** * / * ( non - Javadoc ) * @ see org . kie . api . marshalling . impl . ObjectMarshallingStrategyStore # getStrategyObject ( java . lang . Object ) */ public ObjectMarshallingStrategy getStrategyObject ( Object object ) { } }
for ( int i = 0 , length = this . strategiesList . length ; i < length ; i ++ ) { if ( strategiesList [ i ] . accept ( object ) ) { return strategiesList [ i ] ; } } throw new RuntimeException ( "Unable to find PlaceholderResolverStrategy for class : " + object . getClass ( ) + " object : " + object ) ;
public class BasicBondGenerator { /** * { @ inheritDoc } */ @ Override public IRenderingElement generate ( IAtomContainer container , RendererModel model ) { } }
ElementGroup group = new ElementGroup ( ) ; this . ringSet = this . getRingSet ( container ) ; // Sort the ringSet consistently to ensure consistent rendering . // If this is omitted , the bonds may ' tremble ' . ringSet . sortAtomContainers ( new AtomContainerComparatorBy2DCenter ( ) ) ; for ( IBond bond : container ....
public class AsteriskServerImpl { /** * shutdown */ public List < PeerEntryEvent > getPeerEntries ( ) throws ManagerCommunicationException { } }
ResponseEvents responseEvents = sendEventGeneratingAction ( new SipPeersAction ( ) , 2000 ) ; List < PeerEntryEvent > peerEntries = new ArrayList < > ( 30 ) ; for ( ResponseEvent re : responseEvents . getEvents ( ) ) { if ( re instanceof PeerEntryEvent ) { peerEntries . add ( ( PeerEntryEvent ) re ) ; } } return peerEn...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcLampTypeEnum ( ) { } }
if ( ifcLampTypeEnumEEnum == null ) { ifcLampTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 851 ) ; } return ifcLampTypeEnumEEnum ;
public class MessageServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . MessageService # getAutoDenyList ( java . lang . String ) */ @ Override public AutoDeny [ ] getAutoDenyList ( String CorpNum ) throws PopbillException { } }
return httpget ( "/Message/Denied" , CorpNum , null , AutoDeny [ ] . class ) ;
public class XMLResource { /** * This method will be called when a new XML file has to be stored within the * database . The user request will be forwarded to this method . Afterwards it * creates a response message with the ' created ' HTTP status code , if the * storing has been successful . * @ param system ...
MediaType . TEXT_XML , MediaType . APPLICATION_XML } ) public Response putResource ( @ PathParam ( JaxRxConstants . SYSTEM ) final String system , @ PathParam ( JaxRxConstants . RESOURCE ) final String resource , @ Context final HttpHeaders headers , final InputStream xml ) { final JaxRx impl = Systems . getInstance ( ...
public class PropertiesUtils { /** * Loads a resource from the classpath as properties . * @ param loader * Class loader to use . * @ param resource * Resource to load . * @ return Properties . */ public static Properties loadProperties ( final ClassLoader loader , final String resource ) { } }
checkNotNull ( "loader" , loader ) ; checkNotNull ( "resource" , resource ) ; final Properties props = new Properties ( ) ; try ( final InputStream inStream = loader . getResourceAsStream ( resource ) ) { if ( inStream == null ) { throw new IllegalArgumentException ( "Resource '" + resource + "' not found!" ) ; } props...
public class BlockingCalculator { /** * In ascending order */ protected List < DisabledDuration > createBlockingDurations ( final Iterable < BlockingState > inputBundleEvents ) { } }
final List < DisabledDuration > result = new ArrayList < DisabledDuration > ( ) ; final Set < String > services = ImmutableSet . copyOf ( Iterables . transform ( inputBundleEvents , new Function < BlockingState , String > ( ) { @ Override public String apply ( final BlockingState input ) { return input . getService ( )...
public class QueryResultsRowImpl { /** * Return the FactHandles for the Tuple . * @ return */ public FactHandle [ ] getFactHandles ( ) { } }
int size = size ( ) ; FactHandle [ ] subArray = new FactHandle [ size ] ; System . arraycopy ( this . row . getHandles ( ) , 1 , subArray , 0 , size ) ; return subArray ;
public class BoxFile { /** * Unlocks a file . */ public void unlock ( ) { } }
String queryString = new QueryStringBuilder ( ) . appendParam ( "fields" , "lock" ) . toString ( ) ; URL url = FILE_URL_TEMPLATE . buildWithQuery ( this . getAPI ( ) . getBaseURL ( ) , queryString , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( this . getAPI ( ) , url , "PUT" ) ; JsonObject lockObjec...
public class FileUtils { /** * Method to retrieve all files with given file name pattern in given directory . * Hierarchy of folders is supported . * @ param startDir the directory to hold the files * @ param fileNamePatterns the file names to include * @ return list of test files as filename paths */ public st...
/* file names to be returned */ final List < File > files = new ArrayList < File > ( ) ; /* Stack to hold potential sub directories */ final Stack < File > dirs = new Stack < File > ( ) ; /* start directory */ final File startdir = new File ( startDir ) ; if ( ! startdir . exists ( ) ) { throw new CitrusRuntimeExceptio...
public class CmsUndoChanges { /** * Returns the HTML for the undo changes options and detailed output for single resource operations . < p > * @ return the HTML for the undo changes options */ public String buildDialogOptions ( ) { } }
StringBuffer result = new StringBuffer ( 256 ) ; boolean isMoved = isOperationOnMovedResource ( ) ; if ( ! isMultiOperation ( ) ) { result . append ( dialogSpacer ( ) ) ; result . append ( key ( Messages . GUI_UNDO_LASTMODIFIED_INFO_3 , new Object [ ] { getFileName ( ) , getLastModifiedDate ( ) , getLastModifiedUser ( ...
public class EventDeliverySummaryUrl { /** * Get Resource Url for GetDeliveryAttemptSummary * @ param processId * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attemptin...
UrlFormatter formatter = new UrlFormatter ( "/api/event/push/subscriptions/{subscriptionId}/deliveryattempts/{id}?responseFields={responseFields}" ) ; formatter . formatUrl ( "processId" , processId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "subscriptionId" , subscription...
public class Organizer { /** * Copy collection objects to a given array * @ param collection * the collection source * @ param objects * array destination */ public static void copyToArray ( Collection < Object > collection , Object [ ] objects ) { } }
System . arraycopy ( collection . toArray ( ) , 0 , objects , 0 , objects . length ) ;
public class ProxiedStatusMessageLookupFunction { /** * { @ inheritDoc } */ @ Override public String apply ( @ SuppressWarnings ( "rawtypes" ) final ProfileRequestContext input ) { } }
String msg = null ; if ( input != null ) { ProxiedStatusContext context = input . getSubcontext ( ProxiedStatusContext . class , false ) ; if ( context != null && context . getStatus ( ) != null && context . getStatus ( ) . getStatusMessage ( ) != null ) { msg = context . getStatus ( ) . getStatusMessage ( ) . getMessa...
public class CookieConverter { /** * Converts a Selenium cookie to a HTTP client one . * @ param seleniumCookie the browser cookie to be converted * @ return the converted HTTP client cookie */ public static BasicClientCookie convertToHttpClientCookie ( final Cookie seleniumCookie ) { } }
BasicClientCookie httpClientCookie = new BasicClientCookie ( seleniumCookie . getName ( ) , seleniumCookie . getValue ( ) ) ; httpClientCookie . setDomain ( seleniumCookie . getDomain ( ) ) ; httpClientCookie . setPath ( seleniumCookie . getPath ( ) ) ; httpClientCookie . setExpiryDate ( seleniumCookie . getExpiry ( ) ...
public class FluoOutputFormat { /** * Call this method to initialize the Fluo connection props * @ param conf Job configuration * @ param props Use { @ link org . apache . fluo . api . config . FluoConfiguration } to set props * programmatically */ public static void configure ( Job conf , SimpleConfiguration pro...
try { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; props . save ( baos ) ; conf . getConfiguration ( ) . set ( PROPS_CONF_KEY , new String ( baos . toByteArray ( ) , StandardCharsets . UTF_8 ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class RfSessionFactoryImpl { @ Override public AppSession getSession ( String sessionId , Class < ? extends AppSession > aClass ) { } }
if ( sessionId == null ) { throw new IllegalArgumentException ( "SessionId must not be null" ) ; } if ( ! this . iss . exists ( sessionId ) ) { return null ; } AppSession appSession = null ; try { if ( aClass == ServerRfSession . class ) { IServerRfSessionData sessionData = ( IServerRfSessionData ) this . sessionDataFa...
public class AbstractParsedStmt { /** * Extract all subexpressions of a given expression class from this statement */ protected Set < AbstractExpression > findAllSubexpressionsOfClass ( Class < ? extends AbstractExpression > aeClass ) { } }
HashSet < AbstractExpression > exprs = new HashSet < > ( ) ; if ( m_joinTree != null ) { AbstractExpression treeExpr = m_joinTree . getAllFilters ( ) ; if ( treeExpr != null ) { exprs . addAll ( treeExpr . findAllSubexpressionsOfClass ( aeClass ) ) ; } } return exprs ;
public class Arrays { /** * join multi array * @ param arrays * @ return */ public static byte [ ] join ( List < byte [ ] > arrays ) { } }
int maxlength = 0 ; for ( byte [ ] array : arrays ) { maxlength += array . length ; } byte [ ] rs = new byte [ maxlength ] ; int pos = 0 ; for ( byte [ ] array : arrays ) { System . arraycopy ( array , 0 , rs , pos , array . length ) ; pos += array . length ; } return rs ;
public class PebbleEngineFactory { /** * Creates a PebbleEngine instance . * @ return a PebbleEngine object that can be used to create PebbleTemplate objects */ public PebbleEngine createPebbleEngine ( ) { } }
PebbleEngine . Builder builder = new PebbleEngine . Builder ( ) ; builder . strictVariables ( strictVariables ) ; if ( defaultLocale != null ) { builder . defaultLocale ( defaultLocale ) ; } if ( templateLoaders == null ) { if ( templateLoaderPaths != null && templateLoaderPaths . length > 0 ) { List < Loader < ? > > t...
public class LocalMapStatsProvider { /** * Gets replica address . Waits if necessary . * @ see # waitForReplicaAddress */ private Address getReplicaAddress ( int partitionId , int replicaNumber , int backupCount ) { } }
IPartition partition = partitionService . getPartition ( partitionId ) ; Address replicaAddress = partition . getReplicaAddress ( replicaNumber ) ; if ( replicaAddress == null ) { replicaAddress = waitForReplicaAddress ( replicaNumber , partition , backupCount ) ; } return replicaAddress ;
public class BacnetClient { /** * gateways */ public IdResponse createGateway ( CreateBacnetGatewayRequest request ) { } }
InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , BACNET , GATEWAY ) ; return this . invokeHttpClient ( internalRequest , IdResponse . class ) ;
public class JsHdrsImpl { /** * Get the value of the MessageWaitTime field from the message header . * Javadoc description supplied by JsMessage interface . */ public final Long getMessageWaitTime ( ) { } }
/* If the transient has never been set , get the value in the message */ if ( cachedMessageWaitTime == null ) { cachedMessageWaitTime = ( Long ) getHdr2 ( ) . getField ( JsHdr2Access . MESSAGEWAITTIME ) ; } return cachedMessageWaitTime ;
public class ComposableFutures { /** * builds a lazy future from a producer . the producer itself is cached * and used afresh on every consumption . * @ param producer the result producer * @ param < T > the future type * @ return the future */ public static < T > ComposableFuture < T > buildLazy ( final Produc...
return LazyComposableFuture . build ( producer ) ;
public class AnyAdapter { /** * Marshals an Attribute to a DOM Element . * @ see javax . xml . bind . annotation . adapters . XmlAdapter # marshal ( java . lang . Object ) */ public Object marshal ( org . openprovenance . prov . model . Attribute attribute ) { } }
return DOMProcessing . marshalAttribute ( attribute ) ;