signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultGroovyMethods { /** * internal helper method */ protected static < T > T callClosureForMapEntry ( Closure < T > closure , Map . Entry entry ) { } }
if ( closure . getMaximumNumberOfParameters ( ) == 2 ) { return closure . call ( new Object [ ] { entry . getKey ( ) , entry . getValue ( ) } ) ; } return closure . call ( entry ) ;
public class ClassPathBuilder { /** * Make an effort to find the codebases containing any files required for * analysis . */ private void locateCodebasesRequiredForAnalysis ( IClassPath classPath , IClassPathBuilderProgress progress ) throws InterruptedException , IOException , ResourceNotFoundException { } }
boolean foundJavaLangObject = false ; boolean foundFindBugsAnnotations = false ; boolean foundJSR305Annotations = false ; for ( DiscoveredCodeBase discoveredCodeBase : discoveredCodeBaseList ) { if ( ! foundJavaLangObject ) { foundJavaLangObject = probeCodeBaseForResource ( discoveredCodeBase , "java/lang/Object.class"...
public class AbstractActivator { /** * This method should be used to register services . Services registered with * this method auto de - registered during bundle stop . * @ param iface * is the interface of the service to be used for later retrieval . * @ param instance * is an instance of the object to be r...
logger . info ( "Register service '{}' for interface '{}' (context='" + context . getBundle ( ) . getSymbolicName ( ) + "')." , instance . getClass ( ) . getName ( ) , iface . getName ( ) ) ; ServiceRegistration < ? > serviceRegistration = context . registerService ( iface , instance , dictionary ) ; serviceRegistratio...
public class SVD { /** * Returns U , S , V < sup > T < / sup > matrices for the SVD of the matrix using the * specified SVD algorithm to generate the specified number of singular * values . * Use a { @ link MatrixFactorization } implementation instead . * @ param m the matrix on which the SVD should be computed...
// Determine which algorithm is the fastest in order to decide which // format the matrix file should be written if ( algorithm . equals ( Algorithm . ANY ) ) algorithm = getFastestAvailableAlgorithm ( ) ; if ( algorithm == null ) throw new UnsupportedOperationException ( "No SVD algorithm is available on this system" ...
public class Builder { /** * < b > Required Field < / b > . Software group to which this package belongs . The group describes what sort of * function the software package provides . * @ param group target group . */ public void setGroup ( final CharSequence group ) { } }
if ( group != null ) format . getHeader ( ) . createEntry ( GROUP , group ) ;
public class JsonConverter { /** * 把JSON格式的数据转换为对象 。 * @ param < T > 泛型领域对象 * @ param json JSON格式的数据 * @ param clazz 泛型领域类型 * @ return 领域对象 * @ throws TopException */ public < T > T fromJson ( final Map < ? , ? > json , Class < T > clazz ) throws AlipayApiException { } }
return Converters . convert ( clazz , new Reader ( ) { public boolean hasReturnField ( Object name ) { return json . containsKey ( name ) ; } public Object getPrimitiveObject ( Object name ) { return json . get ( name ) ; } public Object getObject ( Object name , Class < ? > type ) throws AlipayApiException { Object tm...
public class PathComputer { /** * Finds the " content " directory from the installation location * and returns it . If the command - line tool is packaged and * deployed , then the " content " directory is found at the * root of the installation . If the command - line tool is run * from the development environ...
if ( null != installDir ) { // Command - line package File contentDir = new File ( installDir , "content" ) ; if ( contentDir . exists ( ) && contentDir . isDirectory ( ) ) { return contentDir ; } // Development environment File nunaliit2Dir = computeNunaliitDir ( installDir ) ; contentDir = new File ( nunaliit2Dir , "...
public class ReconciliationReportRow { /** * Sets the contractedRevenue value for this ReconciliationReportRow . * @ param contractedRevenue * The revenue calculated based on the { @ link # contractedGoal } * and { @ link # costPerUnit } . * This attribute is calculated by Google and is read - only . */ public vo...
this . contractedRevenue = contractedRevenue ;
public class BinaryTreeNode { /** * Set the child for the specified zone . * @ param zone is the zone to set * @ param newChild is the child to insert * @ return < code > true < / code > if the child was added , otherwise < code > false < / code > */ public final boolean setChildAt ( BinaryTreeZone zone , N newCh...
switch ( zone ) { case LEFT : return setLeftChild ( newChild ) ; case RIGHT : return setRightChild ( newChild ) ; default : throw new IndexOutOfBoundsException ( ) ; }
public class Preconditions { /** * Throws an exception with a message , when CharSequence is null * @ param str is a CharSequence to examine * @ param message for IllegalArgumentException */ public static void checkNotEmpty ( CharSequence str , String message ) { } }
if ( str == null || str . length ( ) == 0 ) { throw new IllegalArgumentException ( message ) ; }
public class BackendManager { /** * Create a single dispatcher */ private RequestDispatcher createDispatcher ( String pDispatcherClass , Converters pConverters , ServerHandle pServerHandle , Restrictor pRestrictor , Configuration pConfig ) { } }
try { Class clazz = ClassUtil . classForName ( pDispatcherClass , getClass ( ) . getClassLoader ( ) ) ; if ( clazz == null ) { throw new IllegalArgumentException ( "Couldn't lookup dispatcher " + pDispatcherClass ) ; } try { Constructor constructor = clazz . getConstructor ( Converters . class , ServerHandle . class , ...
public class ClassLoaderSearchUtilDelegator { /** * Finds a { @ link Class } by name using a series of { @ link ClassLoader } s as the search path * @ param className * @ param classLoaders * @ return * @ throws ClassNotFoundException * If the { @ link Class } could not be found in any of the specified CLs */...
// Delegate return ClassLoaderSearchUtil . findClassFromClassLoaders ( className , classLoaders ) ;
public class SubscriptionMessageHandler { /** * Adds a subscription to the proxy message that is to be sent . * This will either be a delete or reset message . * Reset will add messages to the list to resync with the Neighbour * and the Delete will send it on due to receiving a Reset . * @ param subscription Th...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addSubscriptionToMessage" , new Object [ ] { subscription , new Boolean ( isLocalBus ) } ) ; // Add the subscription related information . iTopics . add ( subscription . getTopic ( ) ) ; if ( isLocalBus ) { // see defect 267686: // local bus subscriptions expect the ...
public class StatsInfo { /** * Value is reported in best suited units ( e . g . milliseconds , seconds , minutes etc ) . * @ param name statistic name * @ return human readable ( formatted ) timer value or 0 ( if stat value is not available ) * @ throws IllegalStateException if provided stat is not time stat */ p...
name . requiresTimer ( ) ; Preconditions . checkState ( name . isTimer ( ) , "Stat %s is not timer stat" , name ) ; final Stopwatch stopwatch = tracker . getTimers ( ) . get ( name ) ; return stopwatch == null ? "0" : stopwatch . toString ( ) ;
public class OADProfile { /** * Offer the next image available in the Firmware Bundle */ private void offerNextImage ( ) { } }
if ( oadState == OADState . OFFERING_IMAGES ) { try { currentImage = firmwareBundle . getNextImage ( ) ; if ( currentImage != null ) { Log . i ( TAG , "Offering image: " + currentImage . name ( ) ) ; writeToCharacteristic ( oadIdentify , currentImage . metadata ( ) ) ; } } catch ( OADException e ) { // This gets thrown...
public class ResourceFactoryTrackerData { /** * Notification that the properties for the ResourceFactory changed . */ public void modifed ( ServiceReference < ResourceFactory > ref ) { } }
String [ ] newInterfaces = getServiceInterfaces ( ref ) ; if ( ! Arrays . equals ( interfaces , newInterfaces ) ) { unregister ( ) ; register ( ref , newInterfaces ) ; } else { registration . setProperties ( getServiceProperties ( ref ) ) ; }
public class SiblingCounter { /** * Create a sibling counter that always return the supplied count , regardless of the name or node . * @ param count the count to be returned ; may not be negative * @ return the counter that always returns { @ code count } ; never null */ public static SiblingCounter constant ( fin...
assert count > - 1 ; return new SiblingCounter ( ) { @ Override public int countSiblingsNamed ( Name childName ) { return count ; } } ;
public class SipServletMessageImpl { /** * Support for GRUU https : / / github . com / Mobicents / sip - servlets / issues / 51 * if the header contains one of the gruu , gr , temp - gruu or pub - gruu , it is allowed to set the Contact Header * as per RFC 5627 */ public static boolean isSystemHeaderAndNotGruu ( Mo...
boolean isSettingGruu = false ; if ( modifiableRule == ModifiableRule . ContactSystem && ( parameterable . getParameter ( "gruu" ) != null || parameterable . getParameter ( "gr" ) != null ) ) { isSettingGruu = true ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Setting gruu so modifying contact header address i...
public class GoogleMapShapeMarkers { /** * Polygon add a marker in the list of markers to where it is closest to the * the surrounding points * @ param marker marker * @ param markers list of markers */ public static void addMarkerAsPolygon ( Marker marker , List < Marker > markers ) { } }
LatLng position = marker . getPosition ( ) ; int insertLocation = markers . size ( ) ; if ( markers . size ( ) > 2 ) { double [ ] distances = new double [ markers . size ( ) ] ; insertLocation = 0 ; distances [ 0 ] = SphericalUtil . computeDistanceBetween ( position , markers . get ( 0 ) . getPosition ( ) ) ; for ( int...
public class NullAway { /** * for method references , we check that the referenced method correctly overrides the * corresponding functional interface method */ @ Override public Description matchMemberReference ( MemberReferenceTree tree , VisitorState state ) { } }
if ( ! matchWithinClass ) { return Description . NO_MATCH ; } Symbol . MethodSymbol referencedMethod = ASTHelpers . getSymbol ( tree ) ; Symbol . MethodSymbol funcInterfaceSymbol = NullabilityUtil . getFunctionalInterfaceMethod ( tree , state . getTypes ( ) ) ; handler . onMatchMethodReference ( this , tree , state , r...
public class Locale { /** * Returns the Unicode locale type associated with the specified Unicode locale key * for this locale . Returns the empty string for keys that are defined with no type . * Returns null if the key is not defined . Keys are case - insensitive . The key must * be two alphanumeric characters ...
if ( ! UnicodeLocaleExtension . isKey ( key ) ) { throw new IllegalArgumentException ( "Ill-formed Unicode locale key: " + key ) ; } return ( localeExtensions == null ) ? null : localeExtensions . getUnicodeLocaleType ( key ) ;
public class NetworkManager { /** * Handles a node joining the cluster . */ private void doNodeJoined ( final Node node ) { } }
tasks . runTask ( new Handler < Task > ( ) { @ Override public void handle ( final Task task ) { if ( currentContext != null ) { log . info ( String . format ( "%s - %s joined the cluster. Uploading components to new node" , NetworkManager . this , node . address ( ) ) ) ; installModules ( node , currentContext , new H...
public class StringUtil { /** * builds up a String with the parameters for the filtering of fields * @ param paramName * @ param paramArgs * @ return String * @ throws IOException */ public static String buildParam ( String paramName , List < String > paramArgs ) throws IOException { } }
StringBuilder sb = new StringBuilder ( ) ; for ( String arg : paramArgs ) { if ( sb . length ( ) > 0 ) { sb . append ( "&" ) ; } sb . append ( paramName ) . append ( "=" ) . append ( URLEncoder . encode ( arg , "UTF-8" ) ) ; } return sb . toString ( ) ;
public class LazyObject { /** * Returns the boolean value stored in this object for the given key . * Returns false if there is no such key . * @ param key the name of the field on this object * @ return the requested boolean value or false if there was no such key */ public boolean optBoolean ( String key ) { } ...
LazyNode token = getOptionalFieldToken ( key ) ; if ( token == null ) return false ; if ( token . type == LazyNode . VALUE_STRING || token . type == LazyNode . VALUE_ESTRING ) { String str = token . getStringValue ( ) . toLowerCase ( ) . trim ( ) ; if ( str . equals ( "true" ) ) return true ; if ( str . equals ( "false...
public class ValidationUtils { /** * Validates actual against expected value of element * @ param actualValue * @ param expectedValue * @ param pathExpression * @ param context * @ throws com . consol . citrus . exceptions . ValidationException if validation fails */ public static void validateValues ( Object...
try { if ( actualValue != null ) { Assert . isTrue ( expectedValue != null , ValidationUtils . buildValueMismatchErrorMessage ( "Values not equal for element '" + pathExpression + "'" , null , actualValue ) ) ; if ( expectedValue instanceof Matcher ) { Assert . isTrue ( ( ( Matcher ) expectedValue ) . matches ( actualV...
public class DirectoryLookupService { /** * Invoke the serviceInstanceUnavailable of the NotificationHandler . * @ param instance * the ServiceInstance . */ protected void onServiceInstanceUnavailable ( ServiceInstance instance ) { } }
if ( instance == null ) { return ; } String serviceName = instance . getServiceName ( ) ; List < NotificationHandler > handlerList = new ArrayList < NotificationHandler > ( ) ; synchronized ( notificationHandlers ) { if ( notificationHandlers . containsKey ( serviceName ) ) { handlerList . addAll ( notificationHandlers...
public class XLinkUtils { /** * Returns an instance to a given Classobject and a List of OpenEngSBModelEntries . * Returns null , if an error happens during the instantiation . */ public static Object createInstanceOfModelClass ( Class clazzObject , List < OpenEngSBModelEntry > entries ) { } }
return ModelUtils . createModel ( clazzObject , entries ) ;
public class WDataTableRenderer { /** * Paints the given WDataTable . * @ param component the WDataTable to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WDataTable table = ( WDataTable ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; xml . appendTagOpen ( "ui:table" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , ...
public class JSR154Filter { private void attributeNotify ( ServletRequest request , String name , Object oldValue , Object newValue ) { } }
ServletRequestAttributeEvent event = new ServletRequestAttributeEvent ( _servletContext , request , name , oldValue == null ? newValue : oldValue ) ; for ( int i = 0 ; i < LazyList . size ( _requestAttributeListeners ) ; i ++ ) { ServletRequestAttributeListener listener = ( ( ServletRequestAttributeListener ) LazyList ...
public class Initialization { /** * @ param extension The File instance of the extension we want to load * @ return a URLClassLoader that loads all the jars on which the extension is dependent */ public static URLClassLoader getClassLoaderForExtension ( File extension , boolean useExtensionClassloaderFirst ) { } }
return loadersMap . computeIfAbsent ( extension , theExtension -> makeClassLoaderForExtension ( theExtension , useExtensionClassloaderFirst ) ) ;
public class Assert { /** * Asserts that two { @ link Object objects } are the same { @ link Object } as determined by the identity comparison . * The assertion holds if and only if the two { @ link Object objects } are the same { @ link Object } in memory . * @ param obj1 { @ link Object left operand } in the iden...
same ( obj1 , obj2 , "[%1$s] is not the same as [%2$s]" , obj1 , obj2 ) ;
public class KeystoreManager { /** * Ensures that a keystore parameter is actually supported by the KeystoreManager . * @ param keystore a keystore containing your private key and the certificate signed by Apple ( File , InputStream , byte [ ] , KeyStore or String for a file path ) * @ throws InvalidKeystoreReferen...
if ( keystore == null ) throw new InvalidKeystoreReferenceException ( ( Object ) null ) ; if ( keystore instanceof KeyStore ) return ; if ( keystore instanceof InputStream ) return ; if ( keystore instanceof String ) keystore = new File ( ( String ) keystore ) ; if ( keystore instanceof File ) { File file = ( File ) ke...
public class CommerceDiscountUsageEntryPersistenceImpl { /** * Removes the commerce discount usage entry with the primary key from the database . Also notifies the appropriate model listeners . * @ param primaryKey the primary key of the commerce discount usage entry * @ return the commerce discount usage entry tha...
Session session = null ; try { session = openSession ( ) ; CommerceDiscountUsageEntry commerceDiscountUsageEntry = ( CommerceDiscountUsageEntry ) session . get ( CommerceDiscountUsageEntryImpl . class , primaryKey ) ; if ( commerceDiscountUsageEntry == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH...
public class PropertyEditorRegistry { /** * Gets an editor for the given property . The lookup is as follow : * < ul > * < li > if propertyDescriptor . getPropertyEditorClass ( ) returns a valid value , * it is returned , else , * < li > if an editor was registered with * { @ link # registerEditor ( Property ...
PropertyEditor editor = null ; if ( property instanceof PropertyDescriptorAdapter ) { PropertyDescriptor descriptor = ( ( PropertyDescriptorAdapter ) property ) . getDescriptor ( ) ; if ( descriptor != null ) { // allow a per / set property editor override PropertyEditorOverride annotation = descriptor . getWriteMethod...
public class EditorUtil { /** * Selects and reveals the given line in given editor . * Must be executed from UI thread . * @ param editorPart * @ param lineNumber */ public static void goToLine ( IEditorPart editorPart , int lineNumber ) { } }
if ( ! ( editorPart instanceof ITextEditor ) || lineNumber < DEFAULT_LINE_IN_EDITOR ) { return ; } ITextEditor editor = ( ITextEditor ) editorPart ; IDocument document = editor . getDocumentProvider ( ) . getDocument ( editor . getEditorInput ( ) ) ; if ( document != null ) { IRegion lineInfo = null ; try { // line cou...
public class RegularUtils { /** * < p > 正则提取匹配到的内容 < / p > * < p > 例如 : < / p > * author : Crab2Died * date : 2017年06月02日 15:49:51 * @ param pattern 匹配目标内容 * @ param reg 正则表达式 * @ param group 提取内容索引 * @ return 提取内容集合 */ public static List < String > match ( String pattern , String reg , int group ) { } }
List < String > matchGroups = new ArrayList < > ( ) ; Pattern compile = Pattern . compile ( reg ) ; Matcher matcher = compile . matcher ( pattern ) ; if ( group > matcher . groupCount ( ) || group < 0 ) throw new IllegalGroupIndexException ( "Illegal match group :" + group ) ; while ( matcher . find ( ) ) { matchGroups...
public class BaseRequest { /** * convertes request to map */ @ Deprecated public Map serialize ( ) throws OpsGenieClientValidationException { } }
validate ( ) ; try { return JsonUtils . toMap ( this ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ;
public class RouterStubManager { /** * Applies action to a randomly picked RouterStub that ' s connected * @ param action */ public void forAny ( Consumer < RouterStub > action ) { } }
while ( ! stubs . isEmpty ( ) ) { RouterStub stub = Util . pickRandomElement ( stubs ) ; if ( stub != null && stub . isConnected ( ) ) { action . accept ( stub ) ; return ; } }
public class IndexNameFormatter { /** * for testing */ public long parseDate ( String timestamp ) { } }
try { return dateFormat ( ) . get ( ) . parse ( timestamp ) . getTime ( ) ; } catch ( ParseException e ) { throw new AssertionError ( e ) ; }
public class AbstractMetricsContext { /** * Called by MetricsRecordImpl . update ( ) . Creates or updates a row in * the internal table of metric data . */ protected void update ( MetricsRecordImpl record ) { } }
String recordName = record . getRecordName ( ) ; TagMap tagTable = record . getTagTable ( ) ; Map < String , MetricValue > metricUpdates = record . getMetricTable ( ) ; RecordMap recordMap = getRecordMap ( recordName ) ; synchronized ( recordMap ) { MetricMap metricMap = recordMap . get ( tagTable ) ; if ( metricMap ==...
public class ProducerSessionProxy { /** * This method will send a message but in chunks . The chunks that are sent are the exact chunks * that are given to us by MFP when we encode the message for the wire . These chunks are actually * sent in seperate transmissions . * @ param tran * @ param msg * @ param re...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendChunkedMessage" , new Object [ ] { tran , msg , requireReply , jfapPriority } ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; List < DataSlice > messageSlices = null ; // First job is to encode the message...
public class AnnotationsClassLoader { /** * If there is a Java SecurityManager create a Permission . * @ param permission The permission */ public void addPermission ( Permission permission ) { } }
if ( ( securityManager != null ) && ( permission != null ) ) { permissionList . add ( permission ) ; }
public class TaskDefinition { /** * A list of container definitions in JSON format that describe the different containers that make up your task . For * more information about container definition parameters and defaults , see < a * href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguid...
if ( containerDefinitions == null ) { containerDefinitions = new com . amazonaws . internal . SdkInternalList < ContainerDefinition > ( ) ; } return containerDefinitions ;
public class MP3Stream { /** * Calculates the bit rate based on the given parameters . * @ param mpegVer * the MPEG version * @ param layer * the layer * @ param code * the code for the bit rate * @ return the bit rate in bits per second */ private static int calculateBitRate ( int mpegVer , int layer , i...
int [ ] arr = null ; if ( mpegVer == AudioFrame . MPEG_V1 ) { switch ( layer ) { case AudioFrame . LAYER_1 : arr = BIT_RATE_MPEG1_L1 ; break ; case AudioFrame . LAYER_2 : arr = BIT_RATE_MPEG1_L2 ; break ; case AudioFrame . LAYER_3 : arr = BIT_RATE_MPEG1_L3 ; break ; } } else { if ( layer == AudioFrame . LAYER_1 ) { arr...
public class H2StreamProcessor { /** * Check if the current stream should be closed * @ return true if the stream should stop processing */ public boolean isStreamClosed ( ) { } }
if ( this . myID == 0 && ! endStream ) { return false ; } if ( state == StreamState . CLOSED ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isStreamClosed stream closed; " + streamId ( ) ) ; } return true ; } boolean rc = muxLink . checkIfGoAwaySendingOrClosing ( ) ;...
public class PropertyWriterImpl { /** * { @ inheritDoc } */ @ Override public Content getPropertyDetails ( Content propertyDetailsTree ) { } }
if ( configuration . allowTag ( HtmlTag . SECTION ) ) { HtmlTree htmlTree = HtmlTree . SECTION ( getMemberTree ( propertyDetailsTree ) ) ; return htmlTree ; } return getMemberTree ( propertyDetailsTree ) ;
public class DatabaseInformationMain { /** * Retrieves a < code > Table < / code > object describing the visible * access rights for all visible columns of all accessible * tables defined within this database . < p > * Each row is a column privilege description with the following * columns : < p > * < pre cla...
Table t = sysTables [ COLUMN_PRIVILEGES ] ; if ( t == null ) { t = createBlankTable ( sysTableHsqlNames [ COLUMN_PRIVILEGES ] ) ; addColumn ( t , "GRANTOR" , SQL_IDENTIFIER ) ; // not null addColumn ( t , "GRANTEE" , SQL_IDENTIFIER ) ; // not null addColumn ( t , "TABLE_CATALOG" , SQL_IDENTIFIER ) ; addColumn ( t , "TA...
public class ZipUtil { /** * Reads the given ZIP stream and executes the given action for a single * entry . * @ param is * input ZIP stream ( it will not be closed automatically ) . * @ param name * entry name . * @ param action * action to be called for this entry . * @ return < code > true < / code >...
SingleZipEntryCallback helper = new SingleZipEntryCallback ( name , action ) ; iterate ( is , helper ) ; return helper . found ( ) ;
public class SingularityClient { /** * Update or add a { @ link SingularityRequestGroup } * @ param requestGroup * The request group to update or add * @ return * A { @ link SingularityRequestGroup } if the update was successful */ public Optional < SingularityRequestGroup > saveRequestGroup ( SingularityReques...
final Function < String , String > requestUri = ( host ) -> String . format ( REQUEST_GROUPS_FORMAT , getApiBase ( host ) ) ; return post ( requestUri , "request group" , Optional . of ( requestGroup ) , Optional . of ( SingularityRequestGroup . class ) ) ;
public class PlotPanel { /** * Initialize toolbar . */ private void initToolBar ( ) { } }
toolbar = new JToolBar ( JToolBar . VERTICAL ) ; toolbar . setFloatable ( false ) ; add ( toolbar , BorderLayout . WEST ) ; JButton button = makeButton ( "save" , SAVE , "Save" , "Save" ) ; toolbar . add ( button ) ; button = makeButton ( "print" , PRINT , "Print" , "Print" ) ; toolbar . add ( button ) ;
public class MutableRoaringBitmap { /** * important : x2 should not have been computed lazily */ protected void lazyor ( final ImmutableRoaringBitmap x2 ) { } }
int pos1 = 0 , pos2 = 0 ; int length1 = highLowContainer . size ( ) ; final int length2 = x2 . highLowContainer . size ( ) ; main : if ( pos1 < length1 && pos2 < length2 ) { short s1 = highLowContainer . getKeyAtIndex ( pos1 ) ; short s2 = x2 . highLowContainer . getKeyAtIndex ( pos2 ) ; while ( true ) { if ( s1 == s2 ...
public class FilteredStrings { /** * Add strings accepted by this filter pattern but prefixed with given string . Strings argument can come from * { @ link File # list ( ) } and can be null in which case this method does nothing . This method accept a prefix argument ; it is * inserted at every string start before ...
if ( strings == null ) { return ; } for ( String string : strings ) { if ( filter . accept ( string ) ) { list . add ( prefix + string ) ; } }
public class BBProcessor { /** * Process bbcodes * 1 . Escape the xml special symbols * 2 . replace bbcodes to HTML - tags * 3 . replace symbols \ r \ n to HTML - tag " & lt ; br / & gt ; " * @ param source the source string * @ return result string * @ see org . kefirsf . bb . TextProcessor # process ( Cha...
Context context = new Context ( ) ; StringBuilder target = new StringBuilder ( source . length ( ) ) ; context . setTarget ( target ) ; Source source1 = new Source ( source ) ; source1 . setConstantSet ( constants ) ; context . setSource ( source1 ) ; context . setScope ( scope ) ; context . setNestingLimit ( nestingLi...
public class ListServicesResult { /** * The list of full ARN entries for each service associated with the specified cluster . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setServiceArns ( java . util . Collection ) } or { @ link # withServiceArns ( java . ...
if ( this . serviceArns == null ) { setServiceArns ( new com . amazonaws . internal . SdkInternalList < String > ( serviceArns . length ) ) ; } for ( String ele : serviceArns ) { this . serviceArns . add ( ele ) ; } return this ;
public class MethodParameter { /** * Return the nested type of the method / constructor parameter . * @ return the parameter type ( never { @ code null } ) * @ see # getNestingLevel ( ) */ public Class < ? > getNestedParameterType ( ) { } }
if ( this . nestingLevel > 1 ) { Type type = getGenericParameterType ( ) ; for ( int i = 2 ; i <= this . nestingLevel ; i ++ ) { if ( type instanceof ParameterizedType ) { Type [ ] args = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; Integer index = getTypeIndexForLevel ( i ) ; type = args [ index != nu...
public class TeaServletRequestStats { /** * Returns an array of template stats . * Returns the template raw and aggregate statistics so as to * better understand the performance of templates through time . * @ return the template stats for this given template . */ public TemplateStats [ ] getTemplateStats ( ) { }...
Collection < TemplateStats > collection = mStatsMap . values ( ) ; TemplateStats [ ] result = null ; if ( collection . size ( ) > 0 ) { result = collection . toArray ( new TemplateStats [ collection . size ( ) ] ) ; } return result ;
public class AnnotationTypeWriterImpl { /** * Get detail links for the navigation bar . * @ return the content tree for the detail links */ protected Content getNavDetailLinks ( ) { } }
Content li = HtmlTree . LI ( contents . detailLabel ) ; li . addContent ( Contents . SPACE ) ; Content ulNav = HtmlTree . UL ( HtmlStyle . subNavList , li ) ; MemberSummaryBuilder memberSummaryBuilder = ( MemberSummaryBuilder ) configuration . getBuilderFactory ( ) . getMemberSummaryBuilder ( this ) ; AbstractMemberWri...
public class DateTimeFormatterBuilder { /** * Appends the zone offset , such as ' + 01:00 ' , to the formatter . * This appends an instruction to print / parse the offset ID to the builder . * During printing , the offset is obtained using a mechanism equivalent * to querying the temporal with { @ link TemporalQu...
appendInternal ( new OffsetIdPrinterParser ( noOffsetText , pattern ) ) ; return this ;
public class HashUtils { /** * Hashes a string using the SHA - 512 algorithm . * @ since 1.1 * @ param data the string to hash * @ param charset the charset of the string * @ return the SHA - 512 hash of the string * @ throws NoSuchAlgorithmException the algorithm is not supported by existing providers */ pub...
return sha512Hash ( data . getBytes ( charset ) ) ;
public class Node { /** * Register a listener for configuration events . This listener * will get called whenever the node ' s configuration changes . * @ param listener The handler for the event */ public void addConfigurationListener ( NodeConfigListener listener ) { } }
StanzaListener conListener = new NodeConfigTranslator ( listener ) ; configEventToListenerMap . put ( listener , conListener ) ; pubSubManager . getConnection ( ) . addSyncStanzaListener ( conListener , new EventContentFilter ( EventElementType . configuration . toString ( ) ) ) ;
public class Utils { /** * If { @ code type } has a { @ code Parcelable . Creator } field instance , return it . */ @ Nullable static VariableElement findCreator ( Elements elements , Types types , TypeMirror type ) { } }
if ( type . getKind ( ) != TypeKind . DECLARED ) { return null ; } DeclaredType declaredType = ( DeclaredType ) type ; TypeElement typeElement = ( TypeElement ) declaredType . asElement ( ) ; return findCreator ( elements , types , typeElement ) ;
public class RecognitionTool { /** * 英文单词识别 * @ param text 识别文本 * @ param start 待识别文本开始索引 * @ param len 识别长度 * @ return 是否识别 */ public static boolean isEnglish ( final String text , final int start , final int len ) { } }
for ( int i = start ; i < start + len ; i ++ ) { char c = text . charAt ( i ) ; if ( ! isEnglish ( c ) ) { return false ; } } // 指定的字符串已经识别为英文串 // 下面要判断英文串是否完整 if ( start > 0 ) { // 判断前一个字符 , 如果为英文字符则识别失败 char c = text . charAt ( start - 1 ) ; if ( isEnglish ( c ) ) { return false ; } } if ( start + len < text . length...
public class ImageClient { /** * Returns the latest image that is part of an image family and is not deprecated . * < p > Sample code : * < pre > < code > * try ( ImageClient imageClient = ImageClient . create ( ) ) { * ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName . of ( " [ PROJECT ] " , ...
GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest . newBuilder ( ) . setFamily ( family == null ? null : family . toString ( ) ) . build ( ) ; return getFromFamilyImage ( request ) ;
public class WVideo { /** * Handles a request for a video . * @ param request the request being responded to . */ private void handleVideoRequest ( final Request request ) { } }
String videoRequested = request . getParameter ( VIDEO_INDEX_REQUEST_PARAM_KEY ) ; int videoFileIndex = 0 ; try { videoFileIndex = Integer . parseInt ( videoRequested ) ; } catch ( NumberFormatException e ) { LOG . error ( "Failed to parse video index: " + videoFileIndex ) ; } Video [ ] video = getVideo ( ) ; if ( vide...
public class ConsonantUtil { /** * * * * * * BEGINNING OF FUNCTION * * * * * */ / * / public static boolean is_jhay ( String str ) { } }
if ( is_vargiya1 ( str ) || is_vargiya2 ( str ) || is_vargiya3 ( str ) || is_vargiya4 ( str ) ) return true ; return false ;
public class AsyncConnectionProvider { /** * Execute an action for all established and pending connections . * @ param action the action . */ public void forEach ( Consumer < ? super T > action ) { } }
connections . values ( ) . forEach ( sync -> sync . doWithConnection ( action ) ) ;
public class Primitives { /** * Returns the corresponding wrapper type of { @ code type } if it is a primitive * type ; otherwise returns { @ code type } itself . Idempotent . * < pre > * wrap ( int . class ) = = Integer . class * wrap ( Integer . class ) = = Integer . class * wrap ( String . class ) = = Stri...
return ( type . isPrimitive ( ) || type == void . class ) ? ( Class < T > ) PrimitiveToWrappers . get ( type ) : type ;
public class ObjectContainerPresentationSpaceSizeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . OBJECT_CONTAINER_PRESENTATION_SPACE_SIZE__PDF_SIZE : setPDFSize ( PDF_SIZE_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class Tree { /** * Add a new leaf to this tree * @ param child * @ return Tree node of the newly added leaf */ public Tree < T > addLeaf ( T child ) { } }
Tree < T > leaf = new Tree < T > ( child ) ; leaf . parent = this ; children . add ( leaf ) ; return leaf ;
public class DefaultEntity { /** * Removes tree based tags for when a null container is set . * @ see TreeMember * @ see RootContainer * @ see TreeDepth */ protected void removeContainerTags ( ) { } }
tags . removeOfType ( TreeMember . class ) ; tags . removeOfType ( RootContainer . class ) ; tags . removeOfType ( TreeDepth . class ) ;
public class HtmlParser { private List < Node > parse ( ) { } }
while ( ! tq . isEmpty ( ) ) { if ( tq . matches ( "<!--" ) ) { parseComment ( ) ; } else if ( tq . matches ( "<![CDATA[" ) ) { parseCdata ( ) ; } else if ( tq . matches ( "<?" ) || tq . matches ( "<!" ) ) { parseXmlDecl ( ) ; } else if ( tq . matches ( "</" ) ) { parseEndTag ( ) ; } else if ( tq . matches ( "<" ) && !...
public class NetworkInterfaceTapConfigurationsInner { /** * Creates or updates a Tap configuration in the specified NetworkInterface . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param tapConfigurationName The name of the tap ...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , tapConfigurationName , tapConfigurationParameters ) . map ( new Func1 < ServiceResponse < NetworkInterfaceTapConfigurationInner > , NetworkInterfaceTapConfigurationInner > ( ) { @ Override public NetworkInterfaceTapConfigura...
public class AssertMatches { /** * Asserts that the element ' s selected option matches the regular expression pattern * provided . If the element isn ' t present or a select , this will constitute a * failure , same as a mismatch . This information will be logged and * recorded , with a screenshot for traceabili...
String selectedOption = checkSelectedOption ( expectedPattern , 0 , 0 ) ; String reason = NO_ELEMENT_FOUND ; if ( selectedOption == null && getElement ( ) . is ( ) . present ( ) ) { reason = ELEMENT_NOT_SELECT ; } assertNotNull ( reason , selectedOption ) ; assertTrue ( "Selected Option Mismatch: option of '" + selecte...
public class AbstractXbaseSemanticSequencer { /** * Contexts : * XExpression returns XForLoopExpression * XAssignment returns XForLoopExpression * XAssignment . XBinaryOperation _ 1_1_0_0_0 returns XForLoopExpression * XOrExpression returns XForLoopExpression * XOrExpression . XBinaryOperation _ 1_0_0_0 retur...
if ( errorAcceptor != null ) { if ( transientValues . isValueTransient ( semanticObject , XbasePackage . Literals . XFOR_LOOP_EXPRESSION__DECLARED_PARAM ) == ValueTransient . YES ) errorAcceptor . accept ( diagnosticProvider . createFeatureValueMissing ( semanticObject , XbasePackage . Literals . XFOR_LOOP_EXPRESSION__...
public class ProxyCertificateUtil { /** * Determines if a specified certificate type indicates a GSI - 2 or GSI - 3 or * GSI = 4 limited proxy certificate . * @ param certType the certificate type to check . * @ return true if certType is a GSI - 2 or GSI - 3 or GSI - 4 limited proxy , * false otherwise . */ pu...
return certType == GSIConstants . CertificateType . GSI_3_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_2_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_4_LIMITED_PROXY ;
public class Counters { /** * Loads a Counter from a text file . File must have the format of one * key / count pair per line , separated by whitespace . * @ param filename * the path to the file to load the Counter from * @ param c * the Class to instantiate each member of the set . Must have a * String co...
ClassicCounter < E > counter = new ClassicCounter < E > ( ) ; loadIntoCounter ( filename , c , counter ) ; return counter ;
public class PolicyUtils { /** * Determines if a list of Resource objects is valid , containing either all NotResource elements or all Resource * elements * @ param resourceList the list of Resource objects * @ throws IllegalArgumentException if the resource list is invalid */ public static void validateResourceL...
boolean hasNotResource = false ; boolean hasResource = false ; for ( Resource resource : resourceList ) { if ( resource . isNotType ( ) ) { hasNotResource = true ; } else { hasResource = true ; } if ( hasResource && hasNotResource ) { // right now only validate that there are only NotResource or only Resource elements ...
public class LongTermRetentionBackupsInner { /** * Lists the long term retention backups for a given location . * @ param locationName The location of the database * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; LongTermRetentionBackup...
return listByLocationWithServiceResponseAsync ( locationName ) . map ( new Func1 < ServiceResponse < Page < LongTermRetentionBackupInner > > , Page < LongTermRetentionBackupInner > > ( ) { @ Override public Page < LongTermRetentionBackupInner > call ( ServiceResponse < Page < LongTermRetentionBackupInner > > response )...
public class CachedDirectoryLookupService { /** * Get the ModelService . * It will query the cache first , if the cache enabled . * @ param serviceName * the Service name . * @ return * the ModelService . */ @ Override public ModelService getModelService ( String serviceName ) { } }
ModelService service = null ; if ( getCache ( ) . isCached ( serviceName ) ) { service = getCache ( ) . getService ( serviceName ) ; } else { service = this . getDirectoryServiceClient ( ) . getService ( serviceName , watcher ) ; if ( service != null ) { getCache ( ) . putService ( serviceName , service ) ; } } return ...
public class CrossChunkCodeMotion { /** * Is the reference node the first { @ code Ref } in an expression like { @ code ' undefined ' ! = typeof * Ref & & x instanceof Ref } ? * < p > It ' s safe to ignore this kind of reference when moving the definition of { @ code Ref } . */ private boolean isUndefinedTypeofGuar...
// reference = > typeof = > ` ! = ` Node undefinedTypeofGuard = reference . getGrandparent ( ) ; if ( undefinedTypeofGuard != null && isUndefinedTypeofGuardFor ( undefinedTypeofGuard , reference ) ) { Node andNode = undefinedTypeofGuard . getParent ( ) ; return andNode != null && andNode . isAnd ( ) && isInstanceofFor ...
public class TokenStore { /** * 大文字 ・ 小文字を無視して { @ link Token . Factor } 中に指定した文字列の何れかを含むかどうか 。 * @ param searchChars * @ return */ private boolean containsAnyInFactor ( final String [ ] searchChars , final boolean ignoreCase ) { } }
for ( Token token : tokens ) { if ( ! ( token instanceof Token . Factor ) ) { continue ; } final Token . Factor factor = token . asFactor ( ) ; if ( Utils . containsAny ( factor . getValue ( ) , searchChars , ignoreCase ) ) { return true ; } } return false ;
public class PlotCanvas { /** * Adds a label to this canvas . */ public void label ( String text , Color color , double ... coord ) { } }
Label label = new Label ( text , coord ) ; label . setColor ( color ) ; add ( label ) ;
public class DayPartTargeting { /** * Gets the timeZone value for this DayPartTargeting . * @ return timeZone * Specifies the time zone to be used for delivering { @ link LineItem } * objects . * This attribute is optional and defaults to * { @ link DeliveryTimeZone # BROWSER } . * Setting this has no effect ...
return timeZone ;
public class PropertyControl { /** * Gets the value of the contextProperties property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set <...
if ( contextProperties == null ) { contextProperties = new ArrayList < PropertyControl . ContextProperties > ( ) ; } return this . contextProperties ;
public class QueryEngine { /** * refreshes the Module cache from the cluster . The Module cache contains a list of register UDF modules . */ public synchronized void refreshModules ( ) { } }
if ( this . moduleCache == null ) this . moduleCache = new TreeMap < String , Module > ( ) ; boolean loadedModules = false ; Node [ ] nodes = client . getNodes ( ) ; for ( Node node : nodes ) { try { String packagesString = Info . request ( infoPolicy , node , "udf-list" ) ; if ( ! packagesString . isEmpty ( ) ) { Stri...
public class MatrixFeatures_DSCC { /** * Checks to see if the two matrices have the same shape and same pattern of non - zero elements * @ param a Matrix * @ param b Matrix * @ return true if the structure is the same */ public static boolean isSameStructure ( DMatrixSparseCSC a , DMatrixSparseCSC b ) { } }
if ( a . numRows == b . numRows && a . numCols == b . numCols && a . nz_length == b . nz_length ) { for ( int i = 0 ; i <= a . numCols ; i ++ ) { if ( a . col_idx [ i ] != b . col_idx [ i ] ) return false ; } for ( int i = 0 ; i < a . nz_length ; i ++ ) { if ( a . nz_rows [ i ] != b . nz_rows [ i ] ) return false ; } r...
public class DataTablesServerData { /** * Create the HC conversion settings to be used for HTML serialization . * @ return Never < code > null < / code > . */ @ Nonnull public static IHCConversionSettings createConversionSettings ( ) { } }
// Create HTML without namespaces final HCConversionSettings aRealCS = HCSettings . getMutableConversionSettings ( ) . getClone ( ) ; aRealCS . getMutableXMLWriterSettings ( ) . setEmitNamespaces ( false ) ; // Remove any " HCCustomizerAutoFocusFirstCtrl " customizer for AJAX calls on // DataTables final IHCCustomizer ...
public class JmxDynamicConfigSource { /** * Used by instances of { @ link ConfigDynamicMBean } to emit values back to the config system . * @ param configName full configuration name from the descriptor * @ param valueOpt the value to be emitted ( if different from last emission ) */ @ Override public void fireEven...
this . emitEvent ( configName , valueOpt ) ;
public class CmsContainerpageDNDController { /** * Checks if the given draggable item is an image . < p > * @ param draggable the item to check * @ return true if the given item is an image */ private boolean isImage ( I_CmsDraggable draggable ) { } }
return ( draggable instanceof CmsResultListItem ) && CmsToolbarAllGalleriesMenu . DND_MARKER . equals ( ( ( CmsResultListItem ) draggable ) . getData ( ) ) ;
public class CmsCategoryService { /** * Reads / Repairs the categories for a resource identified by the given resource name . < p > * For reparation , the resource has to be previously locked . < p > * @ param cms the current cms context * @ param resource the resource to get the categories for * @ param repair...
List < CmsCategory > result = new ArrayList < CmsCategory > ( ) ; String baseFolder = null ; Iterator < CmsRelation > itRelations = cms . getRelationsForResource ( resource , CmsRelationFilter . TARGETS . filterType ( CmsRelationType . CATEGORY ) ) . iterator ( ) ; if ( repair && itRelations . hasNext ( ) ) { baseFolde...
public class ElasticsearchUtil { /** * 创建索引 * @ param indexName 索引名 * @ return true / false */ public boolean createIndex ( String indexName ) { } }
CreateIndexResponse response = getClient ( ) . admin ( ) . indices ( ) . prepareCreate ( indexName ) . execute ( ) . actionGet ( ) ; return response . isAcknowledged ( ) ;
public class TextReportWriter { /** * Writes the part where all { @ link Violations } that were found are listed . * @ param violations { @ link Violations } that were found * @ param out target where the report is written to */ private void printViolations ( Violations violations , PrintWriter out ) { } }
out . println ( "Violations found:" ) ; if ( violations . hasViolations ( ) ) { for ( Violation violation : violations . asList ( ) ) { out . println ( " - " + violation ) ; } } else { out . println ( " - No violations found." ) ; }
public class ZipFileArtifactNotifier { /** * Register a listener to a specified path . * Registration has two effects : The listener is put into a table * which maps the listener to specified path . The path of the * listener are added to the covering paths collection , possibly * causing newly covered paths to...
boolean updatedCoveringPaths = addCoveringPath ( newPath ) ; Collection < ArtifactListenerSelector > listenersForPath = listeners . get ( newPath ) ; if ( listenersForPath == null ) { // Each listeners collection is expected to be small . listenersForPath = new LinkedList < ArtifactListenerSelector > ( ) ; listeners . ...
public class SSLTools { /** * This creates an in - memory keystore containing the certificate and initializes the SSLContext with the the trust * material it contains . * With HttpsURLConnection con , set the connection to use the SSLSocketFactory before { @ code con . connect ( ) } : { @ code * con . setSSLSocke...
byte [ ] certBytes = parseDERFromPEM ( certificateString , CERT_START , CERT_END ) ; X509Certificate cert = generateCertificateFromDER ( certBytes ) ; KeyStore keystore = KeyStore . getInstance ( "JKS" ) ; keystore . load ( null ) ; keystore . setCertificateEntry ( "cert-alias" , cert ) ; TrustManagerFactory tmf = Trus...
public class Tile { /** * Defines the width in pixels that will be used to draw the border of the gauge . * The value will be clamped between 0 and 50 pixels . * @ param WIDTH */ public void setBorderWidth ( final double WIDTH ) { } }
if ( null == borderWidth ) { _borderWidth = clamp ( 0.0 , 50.0 , WIDTH ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { borderWidth . set ( WIDTH ) ; }
public class AbstractFullProjection { /** * Project a vector from scaled space to data space . * @ param < NV > Vector type * @ param v vector in scaled space * @ param factory Object factory * @ return vector in data space */ @ Override public < NV extends NumberVector > NV projectScaledToDataSpace ( double [ ...
final int dim = v . length ; double [ ] vec = new double [ dim ] ; for ( int d = 0 ; d < dim ; d ++ ) { vec [ d ] = scales [ d ] . getUnscaled ( v [ d ] ) ; } return factory . newNumberVector ( vec ) ;
public class Setter { /** * Sets the time in a given { @ link TimePicker } . * @ param timePicker the { @ code TimePicker } object . * @ param hour the hour e . g . 15 * @ param minute the minute e . g . 30 */ public void setTimePicker ( final TimePicker timePicker , final int hour , final int minute ) { } }
if ( timePicker != null ) { Activity activity = activityUtils . getCurrentActivity ( false ) ; if ( activity != null ) { activity . runOnUiThread ( new Runnable ( ) { public void run ( ) { try { timePicker . setCurrentHour ( hour ) ; timePicker . setCurrentMinute ( minute ) ; } catch ( Exception ignored ) { } } } ) ; }...
public class Column { /** * Get a styles property . * @ param styleName the styles name as represented in a { @ link Style } class . * @ return null if the style property is not set . */ public final String getStyleProperty ( StyleName styleName ) { } }
return styleProps != null ? styleProps . get ( styleName ) : null ;
public class AckEventUnmarshaller { /** * Get an Integer field from the JSON . * @ param json JSON document . * @ param fieldName Field name to get . * @ return Integer value of field or null if not present . */ private Integer getIntegerField ( JsonNode json , String fieldName ) { } }
if ( ! json . has ( fieldName ) ) { return null ; } return json . get ( fieldName ) . intValue ( ) ;
public class OCompositeIndexDefinition { /** * { @ inheritDoc } */ @ Override protected void fromStream ( ) { } }
try { className = document . field ( "className" ) ; final List < ODocument > inds = document . field ( "indexDefinitions" ) ; final List < String > indClasses = document . field ( "indClasses" ) ; indexDefinitions . clear ( ) ; for ( int i = 0 ; i < indClasses . size ( ) ; i ++ ) { final Class < ? > clazz = Class . fo...