signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AVQuery { /** * Create a AVQuery with special sub - class . * @ param clazz The AVObject subclass * @ return The AVQuery */ public static < T extends AVObject > AVQuery < T > getQuery ( Class < T > clazz ) { } }
return new AVQuery < T > ( Transformer . getSubClassName ( clazz ) , clazz ) ;
public class LinkHelper { /** * Get the default URL to stream the passed URL . It is assumed that the * servlet is located under the path " / stream " . Because of the logic of the * stream servlet , no parameter are assumed . * @ param aRequestScope * The request web scope to be used . Required for cookie - le...
ValueEnforcer . notNull ( aRequestScope , "RequestScope" ) ; ValueEnforcer . notEmpty ( sURL , "URL" ) ; // If the URL is absolute , use it if ( hasKnownProtocol ( sURL ) ) return new SimpleURL ( sURL ) ; final StringBuilder aPrefix = new StringBuilder ( getStreamServletPath ( ) ) ; if ( ! StringHelper . startsWith ( s...
public class SQLParser { /** * to the extent that comments are supported they have already been stripped out . */ private static List < String > parseExecParameters ( String paramText ) { } }
final String SafeParamStringValuePattern = "#(SQL_PARSER_SAFE_PARAMSTRING)" ; // Find all quoted strings . // Mask out strings that contain whitespace or commas // that must not be confused with parameter separators . // " Safe " strings that don ' t contain these characters don ' t need to be masked // but they DO nee...
public class VarDefBuilder { /** * Adds variable values . */ public VarDefBuilder values ( Stream < VarValueDef > values ) { } }
values . forEach ( value -> varDef_ . addValue ( value ) ) ; return this ;
public class Image { /** * Calls { @ link # createImage ( com . itextpdf . text . pdf . PdfContentByte , java . lang . Object , float ) } , { @ link # applySettings ( com . itextpdf . text . Image ) } , * { @ link com . itextpdf . text . Image # setAbsolutePosition ( float , float ) } and * { @ link # addToCanvas (...
com . itextpdf . text . Image img ; try { img = createImage ( canvas , getData ( ) , getValue ( ( isDrawShadow ( ) ) ? SHADOWOPACITY : OPACITY , Float . class ) ) ; applySettings ( img ) ; } catch ( BadElementException ex ) { throw new VectorPrintException ( ex ) ; } img . setAbsolutePosition ( x , y ) ; try { addToCan...
public class Bar { /** * Set a gradient color from point 1 with color 1 to point2 with color 2. * @ param color1 The first color . * @ param color2 The last color . */ public void setColorGradient ( ColorRgba color1 , ColorRgba color2 ) { } }
setColorGradient ( x , y , color1 , x + maxWidth , y + maxHeight , color2 ) ;
public class ApiOvhEmaildomain { /** * Alter this object properties * REST : PUT / email / domain / delegatedAccount / { email } * @ param body [ required ] New object properties * @ param email [ required ] Email */ public void delegatedAccount_email_PUT ( String email , OvhAccountDelegated body ) throws IOExcep...
String qPath = "/email/domain/delegatedAccount/{email}" ; StringBuilder sb = path ( qPath , email ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class Closeables { /** * Create a single Closeable which closes all of the specified closeables * @ param throwIOException if true , throw any IOException encountered * @ param closeables collection of closeables * @ return closeable */ public static Closeable single ( boolean throwIOException , final Coll...
return single ( throwIOException , closeables . toArray ( new Closeable [ closeables . size ( ) ] ) ) ;
public class GitlabAPI { /** * Returns a List of GitlabRunners . * @ param scope Can be null . Defines type of Runner to retrieve . * @ return List of GitLabRunners * @ throws IOException on Gitlab API call error */ public List < GitlabRunner > getRunners ( GitlabRunner . RunnerScope scope ) throws IOException { ...
return getRunnersWithPagination ( scope , null ) ;
public class CCEncoder { /** * Returns the current configuration of this encoder . If the encoder was constructed with a given configuration , this * configuration will always be used . Otherwise the current configuration of the formula factory is used or - if not * present - the default configuration . * @ retur...
if ( this . config != null ) return this . config ; Configuration ccConfig = this . f . configurationFor ( ConfigurationType . CC_ENCODER ) ; return ccConfig != null ? ( CCConfig ) ccConfig : this . defaultConfig ;
public class HeaderAndFooterGridView { /** * Returns the index of the item , which corresponds to a specific flattened position . * @ param position * The flattened position of the item , whose index should be returned , as an { @ link * Integer } value * @ return The index of the item , which corresponds to th...
int numColumns = getNumColumnsCompatible ( ) ; int headerItemCount = getHeaderViewsCount ( ) * numColumns ; int adapterCount = adapter . getEncapsulatedAdapter ( ) . getCount ( ) ; if ( position < headerItemCount ) { return position / numColumns ; } else if ( position < headerItemCount + adapterCount + getNumberOfPlace...
public class CollectionHelper { /** * Returns the first element from a collection that matches the given predicate or null if no matching element is * found . * @ param items source items * @ param predicate predicate function * @ param < T > type of elements in the source collection * @ return the first elem...
if ( ! isEmpty ( items ) ) { for ( T item : items ) { if ( predicate . apply ( item ) ) { return item ; } } } return null ;
public class AbstractResources { /** * Create a multipart upload request . * @ param url the url * @ param t the object to create * @ param partName the name of the part * @ param inputstream the file inputstream * @ param contentType the type of the file to be attached * @ return the http request * @ thr...
Util . throwIfNull ( inputstream , contentType ) ; Attachment attachment = null ; final String boundary = "----" + System . currentTimeMillis ( ) ; CloseableHttpClient httpClient = HttpClients . createDefault ( ) ; HttpPost uploadFile = createHttpPost ( this . getSmartsheet ( ) . getBaseURI ( ) . resolve ( url ) ) ; tr...
public class EvolutionResult { /** * Return a collector which collects the best < em > result < / em > ( in the native * problem space ) . * < pre > { @ code * final Problem < ISeq < Point > , EnumGene < Point > , Double > tsm = . . . ; * final ISeq < Point > route = Engine . builder ( tsm ) * . optimize ( Op...
requireNonNull ( decoder ) ; return Collector . of ( MinMax :: < EvolutionResult < G , C > > of , MinMax :: accept , MinMax :: combine , mm -> mm . getMax ( ) != null ? mm . getMax ( ) . getBestPhenotype ( ) != null ? decoder . apply ( mm . getMax ( ) . getBestPhenotype ( ) . getGenotype ( ) ) : null : null ) ;
public class StrictMath { /** * Returns the first floating - point argument with the sign of the * second floating - point argument . For this method , a NaN * { @ code sign } argument is always treated as if it were * positive . * @ param magnitude the parameter providing the magnitude of the result * @ para...
return Math . copySign ( magnitude , ( Double . isNaN ( sign ) ? 1.0d : sign ) ) ;
public class JdkZoneProviderSPI { /** * The real implementation using a wrapper around { @ code ZoneRules } derived from given { @ code ZoneId } . * @ param zoneId threeten - zone - identifier * @ return timezone history * @ throws IllegalArgumentException if given id is wrong * @ since 5.0 */ public static Tra...
try { ZoneRules zoneRules = zoneId . getRules ( ) ; ZonalOffset initialOffset = ZonalOffset . ofTotalSeconds ( zoneRules . getOffset ( Instant . MIN ) . getTotalSeconds ( ) ) ; List < ZonalTransition > transitions = new ArrayList < > ( ) ; List < DaylightSavingRule > rules = new ArrayList < > ( ) ; for ( ZoneOffsetTran...
public class Utils { /** * Returns the node where defined group is stored . */ Node getGroupNode ( Session session , Group group ) throws PathNotFoundException , RepositoryException { } }
return getGroupNode ( session , group == null ? "" : group . getId ( ) ) ;
public class CPInstancePersistenceImpl { /** * Returns all the cp instances where CPDefinitionId = & # 63 ; . * @ param CPDefinitionId the cp definition ID * @ return the matching cp instances */ @ Override public List < CPInstance > findByCPDefinitionId ( long CPDefinitionId ) { } }
return findByCPDefinitionId ( CPDefinitionId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class PrimaveraPMFileReader { /** * { @ inheritDoc } */ @ Override public ProjectFile read ( InputStream stream ) throws MPXJException { } }
try { m_projectFile = new ProjectFile ( ) ; m_eventManager = m_projectFile . getEventManager ( ) ; ProjectConfig config = m_projectFile . getProjectConfig ( ) ; config . setAutoTaskUniqueID ( false ) ; config . setAutoResourceUniqueID ( false ) ; config . setAutoCalendarUniqueID ( false ) ; config . setAutoAssignmentUn...
public class Stream { /** * This aggregator operation computes the maximum of tuples in a stream by using the given { @ code comparator } with * { @ code TridentTuple } s . * @ param comparator comparator used in for finding maximum of two tuple values . * @ return the new stream with this operation . */ public S...
Aggregator < ComparisonAggregator . State > max = new MaxWithComparator < > ( comparator ) ; return comparableAggregateStream ( null , max ) ;
public class BaseMessageFilter { /** * Update this object ' s filter with this new tree information . * @ param propTree Changes to the current property tree . */ public final void updateFilterTree ( Map < String , Object > propTree ) { } }
Object [ ] [ ] mxProperties = this . cloneMatrix ( this . getNameValueTree ( ) ) ; mxProperties = this . createNameValueTree ( mxProperties , propTree ) ; // Update these properties this . setFilterTree ( mxProperties ) ; // Update any remote copy of this .
public class IO { /** * { @ inheritDoc } */ @ Override public final < B > IO < B > flatMap ( Function < ? super A , ? extends Monad < B , IO < ? > > > f ) { } }
@ SuppressWarnings ( "unchecked" ) IO < Object > source = ( IO < Object > ) this ; @ SuppressWarnings ( { "unchecked" , "RedundantCast" } ) Function < Object , IO < Object > > flatMap = ( Function < Object , IO < Object > > ) ( Object ) f ; return new Compose < > ( source , Choice2 . b ( flatMap ) ) ;
public class CacheObjectUtil { /** * execute the specified script . * @ param cacheConfigBean the data source of the cache * @ param scripts the lua script . * @ param keyCount the key count . * @ param params the parameters . * @ return the object result . */ public static Single < Object > luaScript ( Cache...
return SingleRxXian . call ( CacheService . CACHE_SERVICE , "cacheLua" , new JSONObject ( ) { { put ( "cacheConfig" , cacheConfigBean ) ; put ( "scripts" , scripts ) ; put ( "keyCount" , keyCount ) ; put ( "params" , params ) ; } } ) . map ( unitResponseObject -> { unitResponseObject . throwExceptionIfNotSuccess ( ) ; ...
public class GeocodeResultBuilder { /** * Create a GeoServiceGeometry from a Geometry . * @ param geometry the Geometry * @ return the GeoServiceGeometry */ public FeatureCollection toGeoServiceGeometry ( final Geometry geometry ) { } }
if ( geometry == null ) { return GeoServiceGeometry . createFeatureCollection ( toLocationFeature ( new LatLng ( Double . NaN , Double . NaN ) , LocationType . UNKNOWN ) , null , null ) ; } return GeoServiceGeometry . createFeatureCollection ( toLocationFeature ( geometry . location , geometry . locationType ) , toBox ...
public class ConfigFileCreator { /** * Returns the all config file found under a directory * @ param dir * @ return A list of files found . Length = 0 if not found files . */ private List < File > getConfigFiles ( File dir ) { } }
String [ ] extensions = { "xml" } ; List < File > configFiles = new ArrayList < File > ( ) ; Collection < File > files = FileUtils . listFiles ( dir , extensions , true ) ; for ( Iterator < File > iterator = files . iterator ( ) ; iterator . hasNext ( ) ; ) { File file = ( File ) iterator . next ( ) ; if ( file . getNa...
public class IsEmptyBuilder { /** * String型の値を追加する 。 * @ param value nullまたは空文字の場合 、 空と判断する 。 * @ param trim 引数valueをトリムした後空文字と判定するかどうか 。 * @ return this . */ public IsEmptyBuilder append ( final String value , final boolean trim ) { } }
if ( isNotEmpty ( ) ) { return this ; } if ( trim ) { if ( value != null && ! value . trim ( ) . isEmpty ( ) ) { setNotEmpty ( ) ; } } else { if ( value != null && ! value . isEmpty ( ) ) { setNotEmpty ( ) ; } } return this ;
public class IOUtil { /** * 递归遍历获取目录下的所有文件 * @ param path 根目录 * @ return 文件列表 */ public static List < File > fileList ( String path ) { } }
List < File > fileList = new LinkedList < File > ( ) ; File folder = new File ( path ) ; if ( folder . isDirectory ( ) ) enumerate ( folder , fileList ) ; else fileList . add ( folder ) ; // 兼容路径为文件的情况 return fileList ;
public class ViterbiAlgorithm { /** * Returns the most likely sequence of states for all time steps . This includes the initial * states / initial observation time step . If an HMM break occurred in the last time step t , * then the most likely sequence up to t - 1 is returned . See also { @ link # isBroken ( ) } ....
if ( message == null ) { // Return empty most likely sequence if there are no time steps or if initial // observations caused an HMM break . return new ArrayList < > ( ) ; } else { return retrieveMostLikelySequence ( ) ; }
public class TypedVector { /** * Replaces the element at the specified position in this Vector with the * specified element . * @ param index * the index at which the element will be placed ; it can be a positive * number , or a negative number that is smaller than the size of the vector ; * see { @ link # ge...
int idx = getRealIndex ( index ) ; return super . set ( idx , element ) ;
public class RadialMenu { /** * Sets the menu model . * @ param menu Structure of { @ link MenuItem } s to display . */ public void setMenu ( Menu menu ) { } }
this . menu = menu ; RadialMenuItem . setupMenuButton ( this , radialMenuParams , ( menu != null ) ? menu . getGraphic ( ) : null , ( menu != null ) ? menu . getText ( ) : null , true ) ;
public class JavascriptRuntime { /** * Gets an array parameter constructor as a String , which then can be * passed to the execute ( ) method . * @ param javascriptObjectType type The type of JavaScript object array to create * @ param ary The array elements * @ return A string which can be passed to the JavaSc...
String fn = getArrayFunction ( "new " + javascriptObjectType , ary ) ; return fn ;
public class Scheduler { public static LocalDate toLocalDate ( Date time ) { } }
return time . toInstant ( ) . atZone ( ZoneId . systemDefault ( ) ) . toLocalDate ( ) ;
public class CmsSearchManager { /** * Sets the maximal wait time for offline index updates after edit operations . < p > * @ param maxIndexWaitTime the maximal wait time to set in milliseconds */ public void setMaxIndexWaitTime ( String maxIndexWaitTime ) { } }
try { setMaxIndexWaitTime ( Long . parseLong ( maxIndexWaitTime ) ) ; } catch ( Exception e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_PARSE_MAX_INDEX_WAITTIME_FAILED_2 , maxIndexWaitTime , new Long ( DEFAULT_MAX_INDEX_WAITTIME ) ) , e ) ; setMaxIndexWaitTime ( DEFAULT_MAX_INDEX_WAITTIM...
public class Scenario3DPortrayal { /** * To draw a link * @ param link */ public void drawLink ( Link link ) { } }
List < Device > linkedDevices = link . getLinkedDevices ( ) ; for ( int i = 0 ; i < linkedDevices . size ( ) ; i ++ ) { Device from = linkedDevices . get ( i ) ; for ( int j = i + 1 ; j < linkedDevices . size ( ) ; j ++ ) { Device to = linkedDevices . get ( j ) ; Edge e = new Edge ( from , to , link ) ; links . addEdge...
public class AuthenticateApi { /** * For formLogout , this is a new request and there is no subject on the thread . A previous * request handled on this thread may not be from this same client . We have to authenticate using * the token and push the subject on thread so webcontainer can use the subject credential t...
// We got a new instance of FormLogoutExtensionProcess every request . logoutSubject = null ; Subject subject = subjectManager . getCallerSubject ( ) ; if ( subject == null || subjectHelper . isUnauthenticated ( subject ) ) { if ( authService == null && securityServiceRef != null ) { authService = securityServiceRef . ...
public class ChunkedOutputStream { /** * Writes the cache out onto the underlying stream * @ throws IOException * @ since 3.0 */ protected void flushCache ( ) throws IOException { } }
if ( cachePosition > 0 ) { byte [ ] chunkHeader = ( Integer . toHexString ( cachePosition ) + "\r\n" ) . getBytes ( StandardCharsets . US_ASCII ) ; stream . write ( chunkHeader , 0 , chunkHeader . length ) ; stream . write ( cache , 0 , cachePosition ) ; stream . write ( ENDCHUNK , 0 , ENDCHUNK . length ) ; cachePositi...
public class ExtensionPassiveScan { /** * Sets the value of { @ code alertThreshold } of the plug - in passive scanner with the given { @ code pluginId } . * If the { @ code alertThreshold } is { @ code OFF } the scanner is also disabled . The call to this method has no effect if no * scanner with the given { @ cod...
PluginPassiveScanner scanner = getPluginPassiveScanner ( pluginId ) ; if ( scanner != null ) { scanner . setAlertThreshold ( alertThreshold ) ; scanner . setEnabled ( ! Plugin . AlertThreshold . OFF . equals ( alertThreshold ) ) ; scanner . save ( ) ; }
public class HTTPUtil { /** * Escape special characters . */ public static String encodeString ( String uri ) { } }
CharBuffer cb = CharBuffer . allocate ( ) ; for ( int i = 0 ; i < uri . length ( ) ; i ++ ) { char ch = uri . charAt ( i ) ; switch ( ch ) { case '<' : cb . append ( "&lt;" ) ; break ; case '>' : cb . append ( "&gt;" ) ; break ; case '&' : cb . append ( "&amp;" ) ; break ; default : cb . append ( ch ) ; } } return cb ....
public class GroovydocManager { /** * Attach Groovydoc annotation to the target element */ private void attachGroovydocAnnotation ( ASTNode node , String docCommentNodeText ) { } }
if ( ! runtimeGroovydocEnabled ) { return ; } if ( ! ( node instanceof AnnotatedNode ) ) { return ; } if ( ! docCommentNodeText . startsWith ( RUNTIME_GROOVYDOC_PREFIX ) ) { return ; } AnnotatedNode annotatedNode = ( AnnotatedNode ) node ; AnnotationNode annotationNode = new AnnotationNode ( ClassHelper . make ( Groovy...
public class Post { /** * An immutable list of terms associated with this post from a specified taxonomy . * @ param taxonomy The taxonomy . * @ return The list of terms . */ public final ImmutableList < TaxonomyTerm > terms ( final String taxonomy ) { } }
ImmutableList < TaxonomyTerm > terms = taxonomyTerms . get ( taxonomy ) ; return terms != null ? terms : ImmutableList . of ( ) ;
public class SerializerSwitcher { /** * Get the value of a property , without using the default properties . This * can be used to test if a property has been explicitly set by the stylesheet * or user . * @ param name The property name , which is a fully - qualified URI . * @ return The value of the property ,...
String value = ( String ) props . get ( qnameString ) ; return value ;
public class CircleManager { /** * Set the CircleTranslate property * The geometry ' s offset . Values are [ x , y ] where negatives indicate left and up , respectively . * @ param value property wrapper value around Float [ ] */ public void setCircleTranslate ( Float [ ] value ) { } }
PropertyValue propertyValue = circleTranslate ( value ) ; constantPropertyUsageMap . put ( PROPERTY_CIRCLE_TRANSLATE , propertyValue ) ; layer . setProperties ( propertyValue ) ;
public class WeeklyOpeningHours { /** * Determines if this instance if " open " at the given day and time ranges . It is only allowed to call this method if the parameter * ' dayOpeningHours ' represents only one day . This means a value like ' Fri 18:00-03:00 ' will lead to an error . To avoid this , call the * { ...
Contract . requireArgNotNull ( "dayOpeningHours" , dayOpeningHours ) ; if ( ! dayOpeningHours . isNormalized ( ) ) { throw new ConstraintViolationException ( "The argument 'dayOpeningHours' is expected to have only hours of a single day, but was: " + dayOpeningHours ) ; } final int idx = weeklyOpeningHours . indexOf ( ...
public class Captions { /** * Source files for the input sidecar captions used during the transcoding process . To omit all sidecar captions , * leave < code > CaptionSources < / code > blank . * @ param captionSources * Source files for the input sidecar captions used during the transcoding process . To omit all...
if ( captionSources == null ) { this . captionSources = null ; return ; } this . captionSources = new com . amazonaws . internal . SdkInternalList < CaptionSource > ( captionSources ) ;
public class MisoScenePanel { /** * documentation inherited from interface */ public void mousePressed ( MouseEvent e ) { } }
// ignore mouse presses if we ' re not responsive if ( ! isResponsive ( ) ) { return ; } if ( e . getButton ( ) == MouseEvent . BUTTON1 ) { if ( _hobject instanceof Sprite ) { handleSpritePressed ( ( Sprite ) _hobject , e . getX ( ) , e . getY ( ) ) ; return ; } else if ( _hobject instanceof SceneObject ) { handleObjec...
public class UpdateSMBFileShareRequest { /** * A list of users or groups in the Active Directory that are allowed to access the file share . A group must be * prefixed with the @ character . For example < code > @ group1 < / code > . Can only be set if Authentication is set to * < code > ActiveDirectory < / code > ...
if ( validUserList == null ) { validUserList = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return validUserList ;
public class AbstractBoostingBagging { /** * { @ inheritDoc } */ @ Override protected void _fit ( Dataframe trainingData ) { } }
Configuration configuration = knowledgeBase . getConfiguration ( ) ; TP trainingParameters = knowledgeBase . getTrainingParameters ( ) ; MP modelParameters = knowledgeBase . getModelParameters ( ) ; // reset previous entries on the bundle resetBundle ( ) ; // first we need to find all the classes int n = trainingData ....
public class ELSupport { /** * but I couldn ' t find it */ @ SuppressWarnings ( "unchecked" ) public static final Enum < ? > coerceToEnum ( final ELContext ctx , final Object obj , @ SuppressWarnings ( "rawtypes" ) Class type ) { } }
if ( ctx != null ) { boolean originalIsPropertyResolved = ctx . isPropertyResolved ( ) ; try { Object result = ctx . getELResolver ( ) . convertToType ( ctx , obj , type ) ; if ( ctx . isPropertyResolved ( ) ) { return ( Enum < ? > ) result ; } } finally { ctx . setPropertyResolved ( originalIsPropertyResolved ) ; } } ...
public class CommandHelper { /** * Convert the value according the type of DeviceData . * @ param deviceDataArgout * the DeviceData attribute to read * @ return String , the result in String format * @ throws DevFailed */ public static String extractToString ( final DeviceData deviceDataArgout ) throws DevFaile...
final Object [ ] values = CommandHelper . extractArray ( deviceDataArgout ) ; Object value = null ; String argout = "" ; if ( values . length == 1 ) { value = values [ 0 ] ; if ( value instanceof DevState ) { argout = StateUtilities . getNameForState ( ( DevState ) value ) ; } else if ( value instanceof DevVarLongStrin...
public class JNDIMBeanRuntime { /** * Used to Register an MBean * @ param on : The ObjectName registration for the MBean * @ param type : The class type of the MBean being register * @ param o : The MBean * @ return : A service registration that provides access to manage the MBean */ private < T > ServiceRegist...
Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( "jmx.objectname" , on . toString ( ) ) ; return context . registerService ( type , o , props ) ;
public class ServerGroupReplicationConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ServerGroupReplicationConfiguration serverGroupReplicationConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( serverGroupReplicationConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( serverGroupReplicationConfiguration . getServerGroupId ( ) , SERVERGROUPID_BINDING ) ; protocolMarshaller . marshall ( serverGroupReplicationConfigur...
public class HttpAuthServiceBuilder { /** * Adds an { @ link Authorizer } . */ public HttpAuthServiceBuilder add ( Authorizer < HttpRequest > authorizer ) { } }
requireNonNull ( authorizer , "authorizer" ) ; if ( this . authorizer == null ) { this . authorizer = authorizer ; } else { this . authorizer = this . authorizer . orElse ( authorizer ) ; } return this ;
public class DiffFactory { /** * Do a full diff . * @ param paramBuilder * { @ link Builder } reference * @ throws TTException */ public static synchronized void invokeFullDiff ( final Builder paramBuilder ) throws TTException { } }
checkParams ( paramBuilder ) ; DiffKind . FULL . invoke ( paramBuilder ) ;
public class BaseParserScreen { /** * Display this screen in html input format . * @ return true if default params were found for this form . * @ param out The http output stream . * @ exception DBException File exception . */ public boolean printData ( PrintWriter out , int iPrintOptions ) { } }
if ( this . getProperty ( DBParams . XML ) != null ) return this . getScreenFieldView ( ) . printData ( out , iPrintOptions ) ; else return super . printData ( out , iPrintOptions ) ;
public class Type { /** * Returns this type converted such that it cannot reference null . */ public Type toNonNull ( ) { } }
if ( isNonNull ( ) ) { return this ; } else { return new Type ( this ) { private static final long serialVersionUID = 1L ; public boolean isNonNull ( ) { return true ; } public boolean isNullable ( ) { return false ; } public Type toNullable ( ) { return Type . this ; } } ; }
public class EditShape { /** * Returns envelope of all coordinates . */ Envelope2D getEnvelope2D ( ) { } }
Envelope2D env = new Envelope2D ( ) ; env . setEmpty ( ) ; VertexIterator vert_iter = queryVertexIterator ( ) ; Point2D pt = new Point2D ( ) ; boolean b_first = true ; for ( int ivertex = vert_iter . next ( ) ; ivertex != - 1 ; ivertex = vert_iter . next ( ) ) { getXY ( ivertex , pt ) ; if ( b_first ) env . merge ( pt ...
public class Request { /** * Issues a GET to the server . * @ return The { @ link Response } from the server * @ throws IOException */ public Response getResource ( ) throws IOException { } }
buildQueryString ( ) ; buildHeaders ( ) ; connection . setDoOutput ( true ) ; connection . setRequestMethod ( "GET" ) ; return readResponse ( ) ;
public class CmsDriverManager { /** * Sets a new parent group for an already existing group . < p > * @ param dbc the current database context * @ param groupName the name of the group that should be written * @ param parentGroupName the name of the parent group to set , * or < code > null < / code > if the par...
CmsGroup group = readGroup ( dbc , groupName ) ; CmsUUID parentGroupId = CmsUUID . getNullUUID ( ) ; // if the group exists , use its id , else set to unknown . if ( parentGroupName != null ) { parentGroupId = readGroup ( dbc , parentGroupName ) . getId ( ) ; } group . setParentId ( parentGroupId ) ; // write the chang...
public class PtrCLog { /** * Send a DEBUG log message * @ param tag * @ param msg * @ param throwable */ public static void d ( String tag , String msg , Throwable throwable ) { } }
if ( sLevel > LEVEL_DEBUG ) { return ; } Log . d ( tag , msg , throwable ) ;
public class TypeSignature { /** * Returns the type signature of a method according to JVM specs */ public String getTypeSignature ( String javasignature , TypeMirror returnType ) throws SignatureException { } }
String signature = null ; // Java type signature . String typeSignature = null ; // Internal type signature . List < String > params = new ArrayList < > ( ) ; // List of parameters . String paramsig = null ; // Java parameter signature . String paramJVMSig = null ; // Internal parameter signature . String returnSig = n...
public class CommerceOrderNoteUtil { /** * Returns the last commerce order note in the ordered set where commerceOrderId = & # 63 ; and restricted = & # 63 ; . * @ param commerceOrderId the commerce order ID * @ param restricted the restricted * @ param orderByComparator the comparator to order the set by ( optio...
return getPersistence ( ) . fetchByC_R_Last ( commerceOrderId , restricted , orderByComparator ) ;
public class IntSets { /** * Validate the specified arguments . */ protected static void checkNotNull ( Object [ ] array ) { } }
checkNotNull ( ( Object ) array ) ; for ( Object o : array ) { checkNotNull ( o ) ; }
public class AbstractSitemapGenerator { /** * Save sitemap to output file * @ param file * Output file * @ param sitemap * Sitemap as array of Strings ( created by constructSitemap ( ) * method ) * @ throws IOException * when error * @ deprecated Use { @ link # toFile ( Path ) } instead */ @ Deprecated ...
try ( BufferedWriter writer = new BufferedWriter ( new FileWriter ( file ) ) ) { for ( String string : sitemap ) { writer . write ( string ) ; } }
public class AbstractMaterialDialog { /** * Attaches all registered decorators to the dialog . * @ param window * The window , the dialog belongs to , as an instance of the class { @ link Window } . The * window may not be null * @ param rootView * The root view of the dialog as an instance of the class { @ l...
Map < ViewType , View > result = new HashMap < > ( ) ; for ( AbstractDecorator < ? , ? > decorator : decorators ) { result . putAll ( decorator . attach ( window , view , result , null ) ) ; decorator . addAreaListener ( rootView ) ; } return result ;
public class ComponentExposedTypeGenerator { /** * Create the " created " hook method . This method will be called on each Component when it ' s * created . It will inject dependencies if any . * @ param dependenciesBuilder Builder for our component dependencies , needed here to inject the * dependencies in the i...
String hasRunCreatedFlagName = "vg$hrc_" + getSuperComponentCount ( component ) ; componentExposedTypeBuilder . addField ( FieldSpec . builder ( boolean . class , hasRunCreatedFlagName , Modifier . PUBLIC ) . addAnnotation ( JsProperty . class ) . build ( ) ) ; MethodSpec . Builder createdMethodBuilder = MethodSpec . m...
public class ValidatorHelper { /** * This method must be synchronized as it is possible for two threads to * enter concurrently while schema = = null and both will try to load and * parse the schema , which may cause a parsing exception : * org . xml . sax . SAXException : FWK005 parse may not be called while par...
if ( schema == null ) { final URL url = ValidatorHelper . class . getResource ( SCHEMA_LOCATION ) ; try { schema = AccessController . doPrivileged ( new PrivilegedExceptionAction < Schema > ( ) { @ Override public Schema run ( ) throws SAXException { return sf . newSchema ( url ) ; } } ) ; } catch ( PrivilegedActionExc...
public class Swagger2MarkupConfigBuilder { /** * Enable use of inter - document cross - references when needed . * @ param prefix Prefix to document in all inter - document cross - references . * @ return this builder */ public Swagger2MarkupConfigBuilder withInterDocumentCrossReferences ( String prefix ) { } }
Validate . notNull ( prefix , "%s must not be null" , "prefix" ) ; config . interDocumentCrossReferencesEnabled = true ; config . interDocumentCrossReferencesPrefix = prefix ; return this ;
public class Model { /** * TODO : override in KMeansModel once that ' s rewritten on water . Model */ public ModelCategory getModelCategory ( ) { } }
return ( isClassifier ( ) ? ( nclasses ( ) > 2 ? ModelCategory . Multinomial : ModelCategory . Binomial ) : ModelCategory . Regression ) ;
public class ModelMetrics { /** * Fetch all ModelMetrics from the KV store . */ protected static List < water . ModelMetrics > fetchAll ( ) { } }
return new ArrayList < water . ModelMetrics > ( H2O . KeySnapshot . globalSnapshot ( ) . fetchAll ( water . ModelMetrics . class ) . values ( ) ) ;
public class ClassUtility { /** * Find and Build the generic type according to assignable and excluded classes . * @ param mainClass The main class used ( that contains at least one generic type ) * @ param assignableClasses if the array contains only one class it define the type of the generic to build , otherwise...
Object object = null ; final Class < ? > objectClass = ClassUtility . findGenericClass ( mainClass , assignableClass ) ; if ( objectClass != null && ( excludedClass == null || ! excludedClass . equals ( objectClass ) ) ) { object = buildGenericType ( mainClass , new Class < ? > [ ] { assignableClass } , parameters ) ; ...
public class Copiers { /** * 基于 Cglib 实现的拷贝 , 不支持 Converter * @ param sourceClass 源对象类型 * @ param targetClass 目标对象类型 * @ return copier */ public static < F , T > Copier < F , T > createCglib ( Class < F > sourceClass , Class < T > targetClass ) { } }
return CopierFactory . getOrCreateCglibCopier ( sourceClass , targetClass ) ;
public class AbstractModbusMaster { /** * Writes a given number of coil states to the slave . * Note that the number of coils to be written is given * implicitly , through { @ link BitVector # size ( ) } . * @ param unitId the slave unit id . * @ param ref the offset of the coil to start writing to . * @ para...
checkTransaction ( ) ; if ( writeMultipleCoilsRequest == null ) { writeMultipleCoilsRequest = new WriteMultipleCoilsRequest ( ) ; } writeMultipleCoilsRequest . setUnitID ( unitId ) ; writeMultipleCoilsRequest . setReference ( ref ) ; writeMultipleCoilsRequest . setCoils ( coils ) ; transaction . setRequest ( writeMulti...
public class ModuleRegistry { /** * Returns a { @ link ResourceLookup } instance that combines all instances * registered by modules . * @ return resource lookup */ public ResourceLookup getResourceLookup ( ) { } }
checkState ( InitializedState . INITIALIZING , InitializedState . INITIALIZED ) ; return new MultiResourceLookup ( aggregatedModule . getResourceLookups ( ) ) ;
public class ConcurrentLinkedHashMap { /** * Returns a value which the specified key is mapped . * At the same time , this method will call the callback interface , the getting entry event will be triggered . * @ param key the key whose associated value is to be returned * @ return the value which the specified k...
LinkedHashMapSegment < K , V > seg = segmentFor ( key . hashCode ( ) ) ; try { seg . lock . lock ( ) ; return mapEventListener . onGetEntry ( ( K ) key , seg . get ( key ) ) ; } finally { seg . lock . unlock ( ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcRelContainedInSpatialStructure ( ) { } }
if ( ifcRelContainedInSpatialStructureEClass == null ) { ifcRelContainedInSpatialStructureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 542 ) ; } return ifcRelContainedInSpatialStructureEClass ;
public class Validator { /** * Reverses a set of properties mapped using the specified property mapping , or the same input * if the description has no mapping * @ param input input map * @ param mapping key value mapping * @ param skip if true , ignore input entries when the key is not present in the mapping ...
if ( null == mapping ) { return input ; } final Map < String , String > rev = new HashMap < String , String > ( ) ; for ( final Map . Entry < String , String > entry : mapping . entrySet ( ) ) { rev . put ( entry . getValue ( ) , entry . getKey ( ) ) ; } return performMapping ( input , rev , skip ) ;
public class CassandraDefs { /** * Create a SlicePredicate that starts at the given column name , selecting up to * { @ link # MAX _ COLS _ BATCH _ SIZE } columns . * @ param startColName Starting column name as a byte [ ] . * @ param endColNameEnding column name as a byte [ ] * @ return SlicePredicate that sta...
if ( startColName == null ) startColName = EMPTY_BYTES ; if ( endColName == null ) endColName = EMPTY_BYTES ; SliceRange sliceRange = new SliceRange ( ByteBuffer . wrap ( startColName ) , ByteBuffer . wrap ( endColName ) , reversed , CassandraDefs . MAX_COLS_BATCH_SIZE ) ; SlicePredicate slicePred = new SlicePredicate ...
public class MaxAbsScaler { /** * Scales each feature by its maximum absolute value . * @ param x a vector to be scaled . The vector will be modified on output . * @ return the input vector . */ @ Override public double [ ] transform ( double [ ] x ) { } }
if ( x . length != scale . length ) { throw new IllegalArgumentException ( String . format ( "Invalid vector size %d, expected %d" , x . length , scale . length ) ) ; } double [ ] y = copy ? new double [ x . length ] : x ; for ( int i = 0 ; i < x . length ; i ++ ) { y [ i ] = x [ i ] / scale [ i ] ; } return y ;
public class Utils { /** * It casts an array of objets to an array of GraphRelationship * @ param o the array of objects * @ return */ public static GraphRelationship [ ] toGRArray ( Object [ ] o ) { } }
GraphRelationship [ ] result = new GraphRelationship [ o . length ] ; System . arraycopy ( o , 0 , result , 0 , o . length ) ; return result ;
public class AsyncDataStream { /** * Add an AsyncWaitOperator . * @ param in The { @ link DataStream } where the { @ link AsyncWaitOperator } will be added . * @ param func { @ link AsyncFunction } wrapped inside { @ link AsyncWaitOperator } . * @ param timeout for the asynchronous operation to complete * @ par...
TypeInformation < OUT > outTypeInfo = TypeExtractor . getUnaryOperatorReturnType ( func , AsyncFunction . class , 0 , 1 , new int [ ] { 1 , 0 } , in . getType ( ) , Utils . getCallLocationName ( ) , true ) ; // create transform AsyncWaitOperator < IN , OUT > operator = new AsyncWaitOperator < > ( in . getExecutionEnvir...
public class CmsSitemapTreeNode { /** * Opens / closes the list of children . < p < * @ param isOpen true if the children should be opened , false if they should be closed */ public void setOpen ( boolean isOpen ) { } }
m_opener . setStyleOpen ( isOpen ) ; m_children . setVisible ( isOpen ) ; m_isOpen = isOpen ;
public class ConfigElement { /** * Sets an attribute on this element that does not have an explicit setter . * @ param name the name * @ param value the value */ public void setExtraAttribute ( String name , String value ) { } }
if ( extraAttributes == null ) { extraAttributes = new HashMap < QName , Object > ( ) ; } if ( value == null ) { extraAttributes . remove ( new QName ( null , name ) ) ; } else { extraAttributes . put ( new QName ( null , name ) , value ) ; }
public class CollectionUtil { /** * map转换 * @ param map 要转换的map * @ param function 转换函数 * @ param < K > KEY类型 * @ param < NEW > 转换后的value类型 * @ param < OLD > 转换前的value类型 * @ return 转换后的map */ public static < K , NEW , OLD > Map < K , NEW > convert ( Map < K , OLD > map , Function < OLD , NEW > function ) { ...
Map < K , NEW > newMap = new HashMap < > ( ) ; map . forEach ( ( k , v ) -> newMap . put ( k , function . apply ( v ) ) ) ; return newMap ;
public class GeneratedCodeRepository { /** * Update the repository class from the given classloader . If the given repository class cannot be instantiated * then this method will throw a TransfuseRuntimeException . * @ throws TransfuseRuntimeException * @ param classLoader */ public final void loadRepository ( Cl...
try { Class repositoryClass = classLoader . loadClass ( repositoryPackage + "." + repositoryName ) ; Repository < T > instance = ( Repository < T > ) repositoryClass . newInstance ( ) ; generatedMap . putAll ( instance . get ( ) ) ; } catch ( ClassNotFoundException e ) { // nothing } catch ( InstantiationException e ) ...
public class Matth { /** * Returns { @ code b } to the { @ code k } th power . Even if the result overflows , it will be equal to * { @ code BigInteger . valueOf ( b ) . pow ( k ) . longValue ( ) } . This implementation runs in { @ code O ( log k ) } * time . * @ throws IllegalArgumentException if { @ code k < 0}...
checkNonNegative ( "exponent" , k ) ; if ( - 2 <= b && b <= 2 ) { switch ( ( int ) b ) { case 0 : return ( k == 0 ) ? 1 : 0 ; case 1 : return 1 ; case ( - 1 ) : return ( ( k & 1 ) == 0 ) ? 1 : - 1 ; case 2 : return ( k < Long . SIZE ) ? 1L << k : 0 ; case ( - 2 ) : if ( k < Long . SIZE ) { return ( ( k & 1 ) == 0 ) ? 1...
public class GobblinApplicationMaster { /** * Build the { @ link YarnService } for the Application Master . */ private YarnService buildYarnService ( Config config , String applicationName , String applicationId , YarnConfiguration yarnConfiguration , FileSystem fs ) throws Exception { } }
return new YarnService ( config , applicationName , applicationId , yarnConfiguration , fs , this . eventBus ) ;
public class UpdateUtils { /** * Get the source URL and store it to a destination file path * @ param sourceUrl url * @ param destinationFilePath destination * @ param username username * @ param password password * @ param factory updater factory * @ throws UpdateException on error */ public static void up...
String tusername = username ; String tpassword = password ; URL url ; try { url = new URL ( sourceUrl ) ; if ( null == username && null == password && null != url . getUserInfo ( ) ) { // try to extract userinfo from URL final String userInfo = url . getUserInfo ( ) ; final String [ ] split = userInfo . split ( ":" , 2...
public class FlowPreparer { /** * Download project zip and unzip it if not exists locally . * @ param proj project to download * @ return the temp dir where the new project is downloaded to , null if no project is downloaded . * @ throws IOException if downloading or unzipping fails . */ @ VisibleForTesting File ...
final String projectDir = generateProjectDirName ( proj ) ; if ( proj . getInstalledDir ( ) == null ) { proj . setInstalledDir ( new File ( this . projectCacheDir , projectDir ) ) ; } // If directory exists , assume it ' s prepared and skip . if ( proj . getInstalledDir ( ) . exists ( ) ) { log . info ( "Project {} alr...
public class BaseExceptionHandler { /** * { @ inheritDoc } */ public MjdbcSQLException convert ( Connection conn , SQLException cause , String sql , Object ... params ) { } }
String causeMessage = cause . getMessage ( ) ; if ( causeMessage == null ) { causeMessage = "" ; } StringBuffer msg = new StringBuffer ( causeMessage ) ; msg . append ( " Query: " ) ; msg . append ( sql ) ; msg . append ( " Parameters: " ) ; if ( params == null ) { msg . append ( "[]" ) ; } else { msg . append ( Arrays...
public class CollectionFuncSup { /** * a chain to simplify ' add ' process * < pre > * $ ( collection ) . add ( e1 ) . add ( e2 ) . add ( e3) * < / pre > * @ param t * the element to add * @ return < code > this < / code > */ @ SuppressWarnings ( "unchecked" ) public < Coll extends CollectionFuncSup < T > >...
Collection < T > coll = ( Collection < T > ) iterable ; coll . add ( t ) ; return ( Coll ) this ;
public class DataUtil { /** * big - endian or motorola format . */ public static int readIntegerBigEndian ( InputStream io ) throws IOException { } }
int value = io . read ( ) ; if ( value < 0 ) throw new EOFException ( ) ; value <<= 24 ; int i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; value |= i << 16 ; i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; value |= i << 8 ; i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; valu...
public class LocalDate { /** * Returns a copy of this date plus the specified number of days . * This LocalDate instance is immutable and unaffected by this method call . * The following three lines are identical in effect : * < pre > * LocalDate added = dt . plusDays ( 6 ) ; * LocalDate added = dt . plus ( P...
if ( days == 0 ) { return this ; } long instant = getChronology ( ) . days ( ) . add ( getLocalMillis ( ) , days ) ; return withLocalMillis ( instant ) ;
public class CasVersion { /** * Gets last modified date / time for the module . * @ return the date / time */ @ SneakyThrows public static ZonedDateTime getDateTime ( ) { } }
val clazz = CasVersion . class ; val resource = clazz . getResource ( clazz . getSimpleName ( ) + ".class" ) ; if ( "file" . equals ( resource . getProtocol ( ) ) ) { return DateTimeUtils . zonedDateTimeOf ( new File ( resource . toURI ( ) ) . lastModified ( ) ) ; } if ( "jar" . equals ( resource . getProtocol ( ) ) ) ...
public class DeleteElasticsearchServiceRoleRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteElasticsearchServiceRoleRequest deleteElasticsearchServiceRoleRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteElasticsearchServiceRoleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ConfigurationUtils { /** * Loads the path level configuration from the get configuration response . * Only client scope properties will be loaded . * @ param response the get configuration RPC response * @ param clusterConf cluster level configuration * @ return the loaded path level configuration ...
String clientVersion = clusterConf . get ( PropertyKey . VERSION ) ; LOG . info ( "Alluxio client (version {}) is trying to load path level configurations" , clientVersion ) ; Map < String , AlluxioConfiguration > pathConfs = new HashMap < > ( ) ; response . getPathConfigsMap ( ) . forEach ( ( path , conf ) -> { Proper...
public class MenuTree { /** * Replace the menu item that has a given parent with the one provided * @ param subMenu the parent * @ param toReplace the menu item to replace by ID */ public void replaceMenuById ( SubMenuItem subMenu , MenuItem toReplace ) { } }
synchronized ( subMenuItems ) { ArrayList < MenuItem > list = subMenuItems . get ( subMenu ) ; int idx = - 1 ; for ( int i = 0 ; i < list . size ( ) ; ++ i ) { if ( list . get ( i ) . getId ( ) == toReplace . getId ( ) ) { idx = i ; } } if ( idx != - 1 ) { MenuItem oldItem = list . set ( idx , toReplace ) ; if ( toRepl...
public class DerivativeTransform { /** * ~ Methods * * * * * */ @ Override public List < Metric > transform ( QueryContext context , List < Metric > metrics ) { } }
SystemAssert . requireArgument ( metrics != null , "Cannot transform null metric/metrics" ) ; return computeDerivedValues ( metrics , - 1L ) ;
public class DukeController { /** * - - - Create link database */ private LinkDatabase makeLinkDatabase ( Properties props ) { } }
String dbtype = get ( props , "duke.linkdbtype" ) ; if ( dbtype . equals ( "jdbc" ) ) return makeJDBCLinkDatabase ( props ) ; else if ( dbtype . equals ( "jndi" ) ) return makeJNDILinkDatabase ( props ) ; else throw new DukeConfigException ( "Unknown link database type '" + dbtype + "'" ) ;
public class ScrollBarButtonIsIncreaseButtonState { /** * { @ inheritDoc } */ public boolean isInState ( JComponent c ) { } }
if ( c != null && c . getParent ( ) != null ) { SeaGlassScrollBarUI ui = ( SeaGlassScrollBarUI ) ( ( JScrollBar ) c . getParent ( ) ) . getUI ( ) ; if ( ui . getIncreaseButton ( ) == c ) { return true ; } } return false ;
public class ServerCommandListener { /** * Start listening for incoming commands . * read ( ) ( accept ( ) / read ( ) ) are blocking , not waiting , operations . * Locks are not suspended while waiting for input */ public void startListening ( ) { } }
if ( listenForCommands ) { listeningThread = new Thread ( "kernel-command-listener" ) { @ Override public void run ( ) { while ( listenForCommands && acceptAndExecuteCommand ( ) ) { // loop intentionally empty } } } ; listeningThread . start ( ) ; }