signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ManagedObject { /** * Driven when the object is locked within a transaction . * This is an intent lock , indicating an intention to update the object . * The lock is lifted after commit or backout of the transaction . * @ param newTransactionLock being associated with this ManagedObject . * @ throw...
final String methodName = "lock" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , newTransactionLock ) ; // Already locked to the requesting Transaction ? while ( transactionLock != newTransactionLock ) { synchronized ( this ) { if ( ! transactionLock...
public class DevicesInner { /** * Creates or updates a Data Box Edge / Gateway resource . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param dataBoxEdgeDevice The resource object . * @ throws IllegalArgumentException thrown if parameters fail the validation ...
return createOrUpdateWithServiceResponseAsync ( deviceName , resourceGroupName , dataBoxEdgeDevice ) . map ( new Func1 < ServiceResponse < DataBoxEdgeDeviceInner > , DataBoxEdgeDeviceInner > ( ) { @ Override public DataBoxEdgeDeviceInner call ( ServiceResponse < DataBoxEdgeDeviceInner > response ) { return response . b...
public class AbstractJSPExtensionProcessor { /** * PM10362 Start */ protected boolean isValidFilePath ( String filePath ) { } }
if ( filePath == null ) return false ; int len = filePath . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( filePath . charAt ( i ) < ' ' ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isValidFilePat...
public class ColumnMetadata { /** * Extract the column name for the given path , returns the path name , if no ColumnMetadata is attached * @ param path patch * @ return column name or path name */ public static String getName ( Path < ? > path ) { } }
Path < ? > parent = path . getMetadata ( ) . getParent ( ) ; if ( parent instanceof EntityPath ) { Object columnMetadata = ( ( EntityPath < ? > ) parent ) . getMetadata ( path ) ; if ( columnMetadata instanceof ColumnMetadata ) { return ( ( ColumnMetadata ) columnMetadata ) . getName ( ) ; } } return path . getMetadata...
public class MessageBuilder { /** * Adds an attachment to the message . * @ param image The image to add as an attachment . * @ param fileName The file name of the image . * @ return The current instance in order to chain call methods . */ public MessageBuilder addAttachment ( BufferedImage image , String fileNam...
delegate . addAttachment ( image , fileName ) ; return this ;
public class RestServiceExceptionFacade { /** * Create a response message as a JSON - String from the given parts . * @ param status is the HTTP { @ link Status } . * @ param error is the catched or wrapped { @ link NlsRuntimeException } . * @ param errorsMap is a map with all validation errors * @ return the c...
String message ; if ( this . exposeInternalErrorDetails ) { message = getExposedErrorDetails ( error ) ; } else { message = error . getLocalizedMessage ( ) ; } return createResponse ( status , error , message , errorsMap ) ;
public class ImplSurfDescribeOps { /** * Simple algorithm for computing the gradient of a region . Can handle image borders */ public static < T extends ImageGray < T > > void naiveGradient ( T ii , double tl_x , double tl_y , double samplePeriod , int regionSize , double kernelSize , boolean useHaar , double [ ] deriv...
SparseScaleGradient < T , ? > gg = SurfDescribeOps . createGradient ( useHaar , ( Class < T > ) ii . getClass ( ) ) ; gg . setWidth ( kernelSize ) ; gg . setImage ( ii ) ; SparseGradientSafe g = new SparseGradientSafe ( gg ) ; // add 0.5 to c _ x and c _ y to have it round when converted to an integer pixel // this is ...
public class ParticipantReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return Participant ResourceSet */ @ Override public ResourceSet < Participant > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class EDBConverter { /** * Returns the entry name for a map key in the EDB format . E . g . the map key for the property " map " with the index 0 * would be " map . 0 . key " . */ public static String getEntryNameForMapKey ( String property , Integer index ) { } }
return getEntryNameForMap ( property , true , index ) ;
public class ZookeeperMgr { /** * Zoo的新建目录 * @ param dir */ public void makeDir ( String dir , String data ) { } }
try { boolean deafult_path_exist = store . exists ( dir ) ; if ( ! deafult_path_exist ) { LOGGER . info ( "create: " + dir ) ; this . writePersistentUrl ( dir , data ) ; } else { } } catch ( KeeperException e ) { LOGGER . error ( "cannot create path: " + dir , e ) ; } catch ( Exception e ) { LOGGER . error ( "cannot cr...
public class Utility { /** * Format a String for representation in a source file . This includes * breaking it into lines and escaping characters using octal notation * when necessary ( control characters and double quotes ) . */ static public final String formatForSource ( String s ) { } }
StringBuilder buffer = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; ) { if ( i > 0 ) buffer . append ( '+' ) . append ( LINE_SEPARATOR ) ; buffer . append ( " \"" ) ; int count = 11 ; while ( i < s . length ( ) && count < 80 ) { char c = s . charAt ( i ++ ) ; if ( c < '\u0020' || c == '"' || c ...
public class Controller { /** * Redirects to referrer if one exists . If a referrer does not exist , it will be redirected to * the < code > defaultReference < / code > . * @ param defaultReference where to redirect - can be absolute or relative ; this will be used in case * the request does not provide a " Refer...
String referrer = context . requestHeader ( "Referer" ) ; referrer = referrer == null ? defaultReference : referrer ; redirect ( referrer ) ;
public class SingleTaskDataPublisher { /** * Get an instance of { @ link SingleTaskDataPublisher } . * @ param dataPublisherClass A concrete class that extends { @ link SingleTaskDataPublisher } . * @ param state A { @ link State } used to instantiate the { @ link SingleTaskDataPublisher } . * @ return A { @ link...
Preconditions . checkArgument ( SingleTaskDataPublisher . class . isAssignableFrom ( dataPublisherClass ) , String . format ( "Cannot instantiate %s since it does not extend %s" , dataPublisherClass . getSimpleName ( ) , SingleTaskDataPublisher . class . getSimpleName ( ) ) ) ; return ( SingleTaskDataPublisher ) DataPu...
public class TokenStream { /** * Attempt to consume this current token as the next tokens as long as they match the expected values , or throw an exception * if the token does not match . * The { @ link # ANY _ VALUE ANY _ VALUE } constant can be used in the expected values as a wildcard . * @ param expected the ...
consume ( expected ) ; for ( String nextExpected : expectedForNextTokens ) { consume ( nextExpected ) ; }
public class CurrencyUnitDataProvider { /** * Registers a currency allowing it to be used . * This method is called by { @ link # registerCurrencies ( ) } to perform the * actual creation of a currency . * @ param currencyCode the currency code , not null * @ param numericCurrencyCode the numeric currency code ...
CurrencyUnit . registerCurrency ( currencyCode , numericCurrencyCode , decimalPlaces , true ) ;
public class HiveJsonSerDe { /** * Indicates how you want Kinesis Data Firehose to parse the date and timestamps that may be present in your input * data JSON . To specify these format strings , follow the pattern syntax of JodaTime ' s DateTimeFormat format * strings . For more information , see < a * href = " h...
if ( timestampFormats == null ) { this . timestampFormats = null ; return ; } this . timestampFormats = new java . util . ArrayList < String > ( timestampFormats ) ;
public class Collector { /** * Deallocate the handlers before removing the specified sources from the TaskMap * @ param sourcesToUnsubscribe The list of sources we have unsubscribed from and await final deallocation */ private void deconfigure ( List < String > sourcesToUnsubscribe ) { } }
for ( String sourceName : sourcesToUnsubscribe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Task deConfig " + this , sourceName ) ; } taskMap . get ( sourceName ) . setHandlerName ( null ) ; // taskMap . get ( sourceName ) . setConfig ( null ) ; taskMap . remove ( ...
public class EmojiParser { /** * Removes a set of emojis from a String * @ param str the string to process * @ param emojisToRemove the emojis to remove from this string * @ return the string without the emojis that were removed */ public static String removeEmojis ( String str , final Collection < Emoji > emojis...
EmojiTransformer emojiTransformer = new EmojiTransformer ( ) { public String transform ( UnicodeCandidate unicodeCandidate ) { if ( ! emojisToRemove . contains ( unicodeCandidate . getEmoji ( ) ) ) { return unicodeCandidate . getEmoji ( ) . getUnicode ( ) + unicodeCandidate . getFitzpatrickUnicode ( ) ; } return "" ; }...
public class TechnologyTargeting { /** * Sets the mobileDeviceTargeting value for this TechnologyTargeting . * @ param mobileDeviceTargeting * The mobile devices being targeted by the { @ link LineItem } . */ public void setMobileDeviceTargeting ( com . google . api . ads . admanager . axis . v201805 . MobileDeviceTa...
this . mobileDeviceTargeting = mobileDeviceTargeting ;
public class MemoryLogTensorAllocation { /** * < pre > * Allocated tensor details . * < / pre > * < code > optional . tensorflow . TensorDescription tensor = 3 ; < / code > */ public org . tensorflow . framework . TensorDescription getTensor ( ) { } }
return tensor_ == null ? org . tensorflow . framework . TensorDescription . getDefaultInstance ( ) : tensor_ ;
public class Cache { /** * Clear all entries ( if anything exists ) for the given hostname and return { @ code true } if anything was removed . */ final boolean clear ( String hostname ) { } }
Entries entries = resolveCache . remove ( hostname ) ; return entries != null && entries . clearAndCancel ( ) ;
public class AbstractMaterialDialogBuilder { /** * Obtains the scrollable area from a specific theme . * @ param themeResourceId * The resource id of the theme , the scrollable area should be obtained from , as an * { @ link Integer } value */ private void obtainScrollableArea ( @ StyleRes final int themeResource...
TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogScrollableAreaTop , R . attr . materialDialogScrollableAreaBottom } ) ; int topIndex = typedArray . getInt ( 0 , - 1 ) ; int bottomIndex = typedArray . getInt ( 1 , - 1 ) ; if ( topI...
public class HylaFaxClientSpi { /** * Creates and returns the hylafax client connection factory . * @ param className * The connection factory class name * @ return The hylafax client connection factory */ protected final HylaFAXClientConnectionFactory createHylaFAXClientConnectionFactory ( String className ) { }...
// create new instance HylaFAXClientConnectionFactory factory = ( HylaFAXClientConnectionFactory ) ReflectionHelper . createInstance ( className ) ; // initialize factory . initialize ( this ) ; return factory ;
public class ReverseSubsequenceMove { /** * Reverse the subsequence by performing a series of swaps in the given permutation solution . * @ param solution permutation solution to which the move is to be applied */ @ Override public void apply ( PermutationSolution solution ) { } }
int start = from ; int stop = to ; int n = solution . size ( ) ; // reverse subsequence by performing a series of swaps // ( works cyclically when start > stop ) int reversedLength ; if ( start < stop ) { reversedLength = stop - start + 1 ; } else { reversedLength = n - ( start - stop - 1 ) ; } int numSwaps = reversedL...
public class ViewMover { /** * Checks whether there is enough space left to move the view horizontally within * its parent container * Calls { @ link # calculateEndLeftBound ( float ) } and { @ link # calculateEndRightBound ( float ) } * to calculate the resulting X coordinate of the view ' s left and right bound...
int parentWidth = getParentView ( ) . getWidth ( ) ; LOGGER . trace ( "Parent view width is: {}" , parentWidth ) ; int endLeftBound = calculateEndLeftBound ( xAxisDelta ) ; int endRightBound = calculateEndRightBound ( xAxisDelta ) ; LOGGER . trace ( "Calculated end bounds: left = {}, right = {}" , endLeftBound , endRig...
public class Para { /** * Creates the root application and returns the credentials for it . * @ return credentials for the root app */ public static Map < String , String > setup ( ) { } }
return newApp ( Config . getRootAppIdentifier ( ) , Config . APP_NAME , false , false ) ;
public class XData { /** * stores a datanode in a xdata file using the given marshallers . For all classes other * than these a special marshaller is required to map the class ' data to a data node * deSerializedObject : * < ul > * < li > Boolean < / li > * < li > Long < / li > * < li > Integer < / li > *...
final Map < String , AbstractDataMarshaller < ? > > marshallerMap = generateMarshallerMap ( true , Arrays . asList ( marshallers ) ) ; marshallerMap . putAll ( generateMarshallerMap ( true , DEFAULT_MARSHALLERS ) ) ; GZIPOutputStream gzipOutputStream = null ; try { gzipOutputStream = new GZIPOutputStream ( out ) ; Outp...
public class UIComponentBase { /** * Save state of the behaviors map . * @ param context the { @ link FacesContext } for this request . * @ return map converted to the array of < code > Object < / code > or null if no behaviors have been set . */ private Object saveBehaviorsState ( FacesContext context ) { } }
Object state = null ; if ( null != behaviors && behaviors . size ( ) > 0 ) { boolean stateWritten = false ; Object [ ] attachedBehaviors = new Object [ behaviors . size ( ) ] ; int i = 0 ; for ( List < ClientBehavior > eventBehaviors : behaviors . values ( ) ) { // we need to take different action depending on whether ...
public class Footer { /** * Render this tag . This method renders during the data grid ' s { @ link DataGridTagModel # RENDER _ STATE _ FOOTER } * state in order to add table rows to the end of a data grid ' s HTML table . If the data grid is rendering * HTML row groups , this tag will output an HTML & lt ; tfoot &...
JspContext jspContext = getJspContext ( ) ; DataGridTagModel dgm = DataGridUtil . getDataGridTagModel ( jspContext ) ; if ( dgm == null ) throw new JspException ( Bundle . getErrorString ( "DataGridTags_MissingDataGridModel" ) ) ; if ( dgm . getRenderState ( ) == DataGridTagModel . RENDER_STATE_FOOTER ) { JspFragment f...
public class OmemoManager { /** * Returns true , if the contact has any active devices published in a deviceList . * @ param contact contact * @ return true if contact has at least one OMEMO capable device . * @ throws SmackException . NotConnectedException * @ throws InterruptedException * @ throws SmackExce...
synchronized ( LOCK ) { OmemoCachedDeviceList deviceList = getOmemoService ( ) . refreshDeviceList ( connection ( ) , getOwnDevice ( ) , contact ) ; return ! deviceList . getActiveDevices ( ) . isEmpty ( ) ; }
public class WhiteboxImpl { /** * Get the type of an anonymous inner class . * @ param declaringClass The class in which the anonymous inner class is declared . * @ param occurrence The occurrence of the anonymous inner class . For example if * you have two anonymous inner classes classes in the * { @ code decl...
return ( Class < Object > ) Class . forName ( declaringClass . getName ( ) + "$" + occurrence ) ;
public class SessionManager { /** * Retrieves the common SYS Session . */ public Session getSysSession ( ) { } }
sysSession . currentSchema = sysSession . database . schemaManager . getDefaultSchemaHsqlName ( ) ; sysSession . isProcessingScript = false ; sysSession . isProcessingLog = false ; sysSession . setUser ( sysSession . database . getUserManager ( ) . getSysUser ( ) ) ; return sysSession ;
public class ns_cluster { /** * < pre > * Use this operation to modify Cluster IP admin ns password . * < / pre > */ public static ns_cluster modify_password ( nitro_service client , ns_cluster resource ) throws Exception { } }
return ( ( ns_cluster [ ] ) resource . perform_operation ( client , "modify_password" ) ) [ 0 ] ;
public class MultifactorAuthenticationUtils { /** * Evaluate event for provider in context set . * @ param principal the principal * @ param service the service * @ param context the context * @ param provider the provider * @ return the set */ public static Set < Event > evaluateEventForProviderInContext ( f...
LOGGER . debug ( "Attempting check for availability of multifactor authentication provider [{}] for [{}]" , provider , service ) ; if ( provider != null ) { LOGGER . debug ( "Provider [{}] is successfully verified" , provider ) ; val id = provider . getId ( ) ; val event = MultifactorAuthenticationUtils . validateEvent...
public class CurrentDatetimeBehavior { /** * { @ inheritDoc } */ @ Override public void renderHead ( final Component component , final IHeaderResponse response ) { } }
super . renderHead ( component , response ) ; response . render ( JavaScriptHeaderItem . forReference ( Application . get ( ) . getJavaScriptLibrarySettings ( ) . getJQueryReference ( ) ) ) ; response . render ( JavaScriptHeaderItem . forReference ( CurrentDatetimeBehavior . DATETIME_PLUGIN_REFERENCE ) ) ; final String...
public class AbstractSpecWithPrimaryKey { /** * Sets the primary key with the specified key components . */ public AbstractSpecWithPrimaryKey < T > withPrimaryKey ( KeyAttribute ... components ) { } }
if ( components == null ) this . keyComponents = null ; else this . keyComponents = Arrays . asList ( components ) ; return this ;
public class CmsSecurityManager { /** * Returns the resources that were subscribed by a user or group set in the filter . < p > * @ param context the request context * @ param poolName the name of the database pool to use * @ param filter the filter that is used to get the subscribed resources * @ return the re...
List < CmsResource > result = null ; CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { result = m_driverManager . readSubscribedResources ( dbc , poolName , filter ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_SUBSCRIBED_RESOURCES_1 , fil...
public class ChorusAssert { /** * Asserts that an object is null . If it isn ' t an { @ link AssertionError } is * thrown . * Message contains : Expected : null but was : object * @ param object * Object to check or < code > null < / code > */ static public void assertNull ( Object object ) { } }
String message = "Expected: <null> but was: " + String . valueOf ( object ) ; assertNull ( message , object ) ;
public class UCharacter { /** * < strong > [ icu ] < / strong > Returns the names for each of the characters in a string * @ param s string to format * @ param separator string to go between names * @ return string of names */ public static String getName ( String s , String separator ) { } }
if ( s . length ( ) == 1 ) { // handle common case return getName ( s . charAt ( 0 ) ) ; } int cp ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i += Character . charCount ( cp ) ) { cp = s . codePointAt ( i ) ; if ( i != 0 ) sb . append ( separator ) ; sb . append ( UCharacter . ge...
public class SlotReference { /** * Get a unique reference to a media slot on the network from which tracks can be loaded . * @ param player the player in which the slot is found * @ param slot the specific type of the slot * @ return the instance that will always represent the specified slot * @ throws NullPoin...
Map < CdjStatus . TrackSourceSlot , SlotReference > playerMap = instances . get ( player ) ; if ( playerMap == null ) { playerMap = new HashMap < CdjStatus . TrackSourceSlot , SlotReference > ( ) ; instances . put ( player , playerMap ) ; } SlotReference result = playerMap . get ( slot ) ; if ( result == null ) { resul...
public class HtmlBuilder { /** * Icon image representing Simon Type . * @ param simonType Simon Type * @ param rootPath Path to root of Simon Console resources */ public T simonTypeImg ( SimonType simonType , String rootPath ) throws IOException { } }
String image = null ; switch ( simonType ) { case COUNTER : image = "TypeCounter.png" ; break ; case STOPWATCH : image = "TypeStopwatch.png" ; break ; case UNKNOWN : image = "TypeUnknown.png" ; break ; } String label = simonType . name ( ) . toLowerCase ( ) ; doBegin ( "img" , null , label + " icon" ) ; attr ( "src" , ...
public class AbstractHibernateCriteriaBuilder { /** * Orders by the specified property name and direction * @ param propertyName The property name to order by * @ param direction Either " asc " for ascending or " desc " for descending * @ return A Order instance */ public org . grails . datastore . mapping . quer...
if ( criteria == null ) { throwRuntimeException ( new IllegalArgumentException ( "Call to [order] with propertyName [" + propertyName + "]not allowed here." ) ) ; } propertyName = calculatePropertyName ( propertyName ) ; Order o ; if ( direction . equals ( ORDER_DESCENDING ) ) { o = Order . desc ( propertyName ) ; } el...
public class InstanceStatusSummary { /** * The system instance health or application instance health . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDetails ( java . util . Collection ) } or { @ link # withDetails ( java . util . Collection ) } if you wa...
if ( this . details == null ) { setDetails ( new com . amazonaws . internal . SdkInternalList < InstanceStatusDetails > ( details . length ) ) ; } for ( InstanceStatusDetails ele : details ) { this . details . add ( ele ) ; } return this ;
public class PortletDefinitionSearcher { /** * Internal search , so shouldn ' t be called as case insensitive . */ @ Override public EntityIdentifier [ ] searchForEntities ( String query , SearchMethod method ) throws GroupsException { } }
boolean allowPartial = true ; switch ( method ) { case DISCRETE : allowPartial = false ; break ; case STARTS_WITH : query = query + "%" ; break ; case ENDS_WITH : query = "%" + query ; break ; case CONTAINS : query = "%" + query + "%" ; break ; default : throw new GroupsException ( "Unknown search type" ) ; } // get th...
public class JPAPUnitInfo { /** * F1879-16302 */ String dump ( ) { } }
StringBuilder sbuf = new StringBuilder ( ) ; sbuf . append ( "\n" ) . append ( toString ( ) ) ; sbuf . append ( "\n PersistenceUnit name : " ) . append ( ivArchivePuId . getPuName ( ) ) ; sbuf . append ( "\n Schema Version : " ) . append ( xmlSchemaVersion ) ; // F743-8064 sbuf . append ( "\t Archive name ...
public class IO { /** * Write a character to a { @ link Writer } . * The writer is leave open after the character after writing . * @ param c * the character to be written * @ param writer * the writer to which the character is written */ public static void write ( char c , Writer writer ) { } }
try { writer . write ( c ) ; } catch ( IOException e ) { throw E . ioException ( e ) ; }
import java . util . * ; class ElementFrequency { /** * Calculate the frequency of each element in a list of lists . * Examples : * > > > elementFrequency ( Arrays . asList ( Arrays . asList ( 1 , 2 , 3 , 2 ) , Arrays . asList ( 4 , 5 , 6 , 2 ) , Arrays . asList ( 7 , 1 , 9 , 5 ) ) ) * { 2 = 3 , 1 = 2 , 5 = 2 , 3...
HashMap < Integer , Integer > freqTable = new HashMap < Integer , Integer > ( ) ; for ( List < Integer > list : lists ) { for ( Integer elem : list ) { freqTable . put ( elem , freqTable . getOrDefault ( elem , 0 ) + 1 ) ; } } return freqTable ;
public class TSDB { /** * Collects the stats for a { @ link UniqueId } . * @ param uid The instance from which to collect stats . * @ param collector The collector to use . */ private static void collectUidStats ( final UniqueId uid , final StatsCollector collector ) { } }
collector . record ( "uid.cache-hit" , uid . cacheHits ( ) , "kind=" + uid . kind ( ) ) ; collector . record ( "uid.cache-miss" , uid . cacheMisses ( ) , "kind=" + uid . kind ( ) ) ; collector . record ( "uid.cache-size" , uid . cacheSize ( ) , "kind=" + uid . kind ( ) ) ; collector . record ( "uid.random-collisions" ,...
public class MapLoader { /** * Loads the specified values into the specified object instance . * @ param item the object into which values are being loaded * @ param vals the values to load into the object */ public void load ( T item , Map vals ) { } }
for ( Object k : vals . keySet ( ) ) { Class cls = item . getClass ( ) ; String key = ( String ) k ; Object val = vals . get ( key ) ; Field f = null ; int mod ; while ( f == null ) { try { f = cls . getDeclaredField ( key ) ; } catch ( NoSuchFieldException e ) { // ignore } if ( f == null ) { cls = cls . getSuperclass...
public class Logger { /** * Remove the specified appender from the appender list . * @ param appender the < code > Appender < / code > to remove . */ public void removeAppender ( Appender appender ) throws IllegalArgumentException { } }
if ( appender == null ) { throw new IllegalArgumentException ( "The appender must not be null." ) ; } if ( appender . isLogOpen ( ) ) { try { appender . close ( ) ; } catch ( IOException e ) { Log . e ( TAG , "Failed to close appender. " + e ) ; } } appenderList . remove ( appender ) ;
public class LayoutParser { /** * { @ inheritDoc } */ @ Override public void startElement ( String namespaceURI , String sName , String qName , Attributes attrs ) throws SAXException { } }
if ( isParsing || qName . equals ( currentRoot ) ) { isParsing = true ; currentNode = new XMLNode ( currentNode , qName ) ; for ( int i = 0 ; i < attrs . getLength ( ) ; i ++ ) currentNode . attrs . put ( attrs . getLocalName ( i ) , attrs . getValue ( i ) ) ; if ( qName . equals ( currentRoot ) ) xmlElementsMap . put ...
public class FileCopyProgressInputStream { /** * { @ inheritDoc } */ public final synchronized void reset ( ) throws IOException { } }
in . reset ( ) ; bytesRead = size - in . available ( ) ; if ( listener != null ) { listener . updateByte ( bytesRead ) ; }
public class NDArrayMessage { /** * Returns the size needed in bytes * for a bytebuffer for a given ndarray message . * The formula is : * { @ link AeronNDArraySerde # byteBufferSizeFor ( INDArray ) } * + size of dimension length ( 4) * + time stamp size ( 8) * + index size ( 8) * + 4 * message . getDimen...
int enumSize = 4 ; int nInts = 4 * message . getDimensions ( ) . length ; int sizeofDimensionLength = 4 ; int timeStampSize = 8 ; int indexSize = 8 ; return enumSize + nInts + sizeofDimensionLength + timeStampSize + indexSize + AeronNDArraySerde . byteBufferSizeFor ( message . getArr ( ) ) ;
public class JsonConverter { /** * 受信したログデータに以下のフィールドが存在した場合 、 数値に変換する 。 < br > * 変換対象のフィールドは以下の通り 。 < br > * @ param jsonMap 受信したログデータ ( JSON ) */ private void convertToNumeric ( Map < String , Object > jsonMap ) { } }
if ( jsonMap . containsKey ( "reqtime" ) == true ) { Long reqtime = Long . parseLong ( jsonMap . get ( "reqtime" ) . toString ( ) ) ; jsonMap . put ( "reqtime" , reqtime ) ; } else { jsonMap . put ( "reqtime" , 0L ) ; } if ( jsonMap . containsKey ( "reqtime_microsec" ) == true ) { Long reqtimeMicro = Long . parseLong (...
public class Privateer { /** * Calls the specified method on the Object o with the specified arguments . Returns the * result as an Object . Only methods declared on the class for Object o can be called . * The length of the vararg list of arguments to be passed to the method must match * what the method expects ...
Method method = null ; if ( args == null || args . length == 0 ) { method = o . getClass ( ) . getDeclaredMethod ( methodName ) ; } else { Class < ? > [ ] types = new Class [ args . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { types [ i ] = args [ i ] . getClass ( ) ; } try { method = o . getClass ( ) . ge...
public class ZookeeperUtil { /** * Parses server section of Zookeeper connection string */ public static String parseServers ( String zookeepers ) { } }
int slashIndex = zookeepers . indexOf ( "/" ) ; if ( slashIndex != - 1 ) { return zookeepers . substring ( 0 , slashIndex ) ; } return zookeepers ;
public class JPAAuditLogService { /** * / * ( non - Javadoc ) * @ see org . jbpm . process . audit . AuditLogService # findProcessInstances ( java . lang . String ) */ @ Override public List < ProcessInstanceLog > findProcessInstances ( String processId ) { } }
EntityManager em = getEntityManager ( ) ; Query query = em . createQuery ( "FROM ProcessInstanceLog p WHERE p.processId = :processId" ) . setParameter ( "processId" , processId ) ; return executeQuery ( query , em , ProcessInstanceLog . class ) ;
public class ServersInner { /** * Gets a list of servers in a resource groups . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ throws IllegalArgumentException thrown if parameters fail the vali...
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < ServerInner > > , Page < ServerInner > > ( ) { @ Override public Page < ServerInner > call ( ServiceResponse < Page < ServerInner > > response ) { return response . body ( ) ; } } ) ;
public class WebApp31 { /** * New method added for HttpSessionIdListener */ private void addHttpSessionIdListener ( HttpSessionIdListener listener , boolean securityCheckNeeded ) throws SecurityException { } }
if ( securityCheckNeeded ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( perm ) ; } } ( ( IHttpSessionContext31 ) this . getSessionContext ( ) ) . addHttpSessionIdListener ( listener , name ) ;
public class Optional { /** * Invokes the given mapping function on inner value if present . * @ param < U > the type of result value * @ param mapper mapping function * @ return an { @ code Optional } with transformed value if present , * otherwise an empty { @ code Optional } * @ throws NullPointerException...
if ( ! isPresent ( ) ) return empty ( ) ; return Optional . ofNullable ( mapper . apply ( value ) ) ;
public class HttpTunnelServer { /** * Handle an incoming HTTP connection . * @ param httpConnection the HTTP connection * @ throws IOException in case of I / O errors */ protected void handle ( HttpConnection httpConnection ) throws IOException { } }
try { getServerThread ( ) . handleIncomingHttp ( httpConnection ) ; httpConnection . waitForResponse ( ) ; } catch ( ConnectException ex ) { httpConnection . respond ( HttpStatus . GONE ) ; }
public class InternalSimpleAntlrParser { /** * InternalSimpleAntlr . g : 445:1 : entryRuleParameter returns [ EObject current = null ] : iv _ ruleParameter = ruleParameter EOF ; */ public final EObject entryRuleParameter ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleParameter = null ; try { // InternalSimpleAntlr . g : 446:2 : ( iv _ ruleParameter = ruleParameter EOF ) // InternalSimpleAntlr . g : 447:2 : iv _ ruleParameter = ruleParameter EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getParameterRule ( ) ) ; } ...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcRoleEnum ( ) { } }
if ( ifcRoleEnumEEnum == null ) { ifcRoleEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 888 ) ; } return ifcRoleEnumEEnum ;
public class Bridge { /** * Convenience method to create a Bridge object from two call ids * @ param client the client * @ param callId1 the call id * @ param callId2 the call id * @ return the Bridge * @ throws IOException unexpected error . */ public static Bridge create ( final BandwidthClient client , fin...
assert ( callId1 != null ) ; final HashMap < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "bridgeAudio" , "true" ) ; String [ ] callIds = null ; if ( callId1 != null && callId2 != null ) { callIds = new String [ ] { callId1 , callId2 } ; } else if ( callId1 != null && callId2 == null ...
public class FastaAFPChainConverter { /** * Prints out the XML representation of an AFPChain from a file containing exactly two FASTA sequences . * @ param args * A String array of fasta - file structure - 1 - name structure - 2 - name * @ throws StructureException * @ throws IOException */ public static void m...
if ( args . length != 3 ) { System . err . println ( "Usage: FastaAFPChainConverter fasta-file structure-1-name structure-2-name" ) ; return ; } File fasta = new File ( args [ 0 ] ) ; Structure structure1 = StructureTools . getStructure ( args [ 1 ] ) ; Structure structure2 = StructureTools . getStructure ( args [ 2 ] ...
public class Sum { /** * Returns true if one of the sub - constraints still contains mandatory cases * @ return true if at least on of the sub - constraints contains at least one mandatory case */ @ Override public boolean hasNextCase ( ) { } }
for ( ConstraintWrap wrap : summands ) { if ( wrap . constraint . hasNextCase ( ) ) { return true ; } } return false ;
public class Sorting { /** * Adds field to sort by . * @ param fieldName Property name to sort by . * @ param sortDirection Sort direction . */ public void addField ( String fieldName , SortDirection sortDirection ) { } }
if ( sortFields == null ) sortFields = new HashMap < > ( ) ; sortFields . put ( fieldName , sortDirection ) ;
public class FileUtils { /** * Replaces OS specific illegal characters from any filename with ' _ ' , * including ( / \ n \ r \ t ) on all operating systems , ( ? * \ < > | " ) * on Windows , ( ` ) on unix . * @ param name the filename to check for illegal characters * @ return String containing the cleaned fil...
// if the name is too long , reduce it . We don ' t go all the way // up to 256 because we don ' t know how long the directory name is // We want to keep the extension , though . if ( name . length ( ) > 180 ) { int extStart = name . lastIndexOf ( '.' ) ; if ( extStart == - 1 ) { // no extension , weird , but possible ...
public class SimpleExpressionsPackageImpl { /** * Creates the meta - model objects for the package . This method is * guarded to have no affect on any invocation but its first . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void createPackageContents ( ) { } }
if ( isCreated ) return ; isCreated = true ; // Create classes and their features ifConditionEClass = createEClass ( IF_CONDITION ) ; createEAttribute ( ifConditionEClass , IF_CONDITION__ELSEIF ) ; createEReference ( ifConditionEClass , IF_CONDITION__CONDITION ) ; expressionEClass = createEClass ( EXPRESSION ) ; number...
public class CmsEditorCssHandlerDefault { /** * Finds the style sheet by reading the template property of the template for a given path . < p > * @ param cms the current CMS context * @ param editedResourcePath the resource path * @ return the CSS uri from the template for the given path */ private String interna...
if ( editedResourcePath == null ) { return "" ; } String result = "" ; try { // determine the path of the template String templatePath = "" ; try { templatePath = cms . readPropertyObject ( editedResourcePath , CmsPropertyDefinition . PROPERTY_TEMPLATE , true ) . getValue ( "" ) ; if ( CmsTemplateContextManager . isPro...
public class AbstractWrapAdapter { /** * overwrite the getItemViewType to correctly return the value from the FastAdapter * @ param position * @ return */ @ Override public int getItemViewType ( int position ) { } }
if ( shouldInsertItemAtPosition ( position ) ) { return getItem ( position ) . getType ( ) ; } else { return mAdapter . getItemViewType ( position - itemInsertedBeforeCount ( position ) ) ; }
public class PopupButtonClicker { /** * Commander which clicks on a popup button . * @ param timeout the timeout value ; String - the button text . * @ return true if the command is successfully performed . * @ throws QTasteException */ @ Override public Boolean executeCommand ( int timeout , String componentName...
setData ( data ) ; long maxTime = System . currentTimeMillis ( ) + 1000 * timeout ; String buttonText = mData [ 0 ] . toString ( ) ; component = null ; while ( System . currentTimeMillis ( ) < maxTime ) { JDialog targetPopup = null ; for ( JDialog dialog : findPopups ( ) ) { if ( ! dialog . isVisible ( ) || ! dialog . ...
public class Lock { /** * This method is called to request a shared lock . There are conditions under which a * shared lock cannot be granted and this method will block until no such conditions * apply . When the method returns the thread has been granted an additional shared * lock . A single thread may hold any...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getSharedLock" , new Object [ ] { this , new Integer ( requestId ) } ) ; Thread currentThread = Thread . currentThread ( ) ; Integer count = null ; synchronized ( this ) { // If this thread does not have any existing shared locks and there is a thread waiting to get the...
public class GobblinConstructorUtils { /** * Utility method to create an instance of < code > clsName < / code > using the constructor matching the arguments , < code > args < / code > * @ param superType of < code > clsName < / code > . The new instance is cast to superType * @ param clsName complete cannonical na...
try { return ( T ) ConstructorUtils . invokeConstructor ( Class . forName ( clsName ) , args ) ; } catch ( NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e ) { throw new IllegalArgumentException ( e ) ; }
public class SessionImpl { /** * Check for possible expiration of this existing session . This will * update the last access time if still valid , and changes the isNew * flag to false if not already ( since we now know the client has * re - used the session information ) . This will return true if the * sessio...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "checkExpiration: " + this ) ; } if ( isInvalid ( ) ) { // we ' re marked invalid already return true ; } long now = System . currentTimeMillis ( ) ; if ( ( NO_TIMEOUT == this . maxInactiveTime ) || ( this . maxInactiveTime >...
public class ProbeManagerImpl { /** * Determine if the named class is one that should be excluded from * monitoring via probe injection . The patterns below generally * include classes required to implement JVM function on which the * monitoring code depends . * @ param className the internal name of the class ...
// We rely heavily on reflection to deliver probes if ( className . startsWith ( "java/lang/reflect" ) ) { return true ; } // Miscellaneous sun . misc classes if ( className . startsWith ( "sun/misc" ) ) { return true ; } // Sun VM generated accessors wreak havoc if ( className . startsWith ( "sun/reflect" ) ) { return...
public class MasterSlaveTopologyRefresh { /** * Load master replica nodes . Result contains an ordered list of { @ link RedisNodeDescription } s . The sort key is the latency . * Nodes with lower latency come first . * @ param seed collection of { @ link RedisURI } s * @ return mapping between { @ link RedisURI }...
CompletableFuture < List < RedisNodeDescription > > future = topologyProvider . getNodesAsync ( ) ; Mono < List < RedisNodeDescription > > initialNodes = Mono . fromFuture ( future ) . doOnNext ( nodes -> { addPasswordIfNeeded ( nodes , seed ) ; } ) ; return initialNodes . map ( this :: getConnections ) . flatMap ( asy...
public class AnnotationProcessor { /** * Find mathing definition for same method . . . * @ param add to search * @ param method base * @ return found definition or null if no match found */ private static RouteDefinition find ( Map < RouteDefinition , Method > add , Method method ) { } }
if ( add == null || add . size ( ) == 0 ) { return null ; } for ( RouteDefinition additional : add . keySet ( ) ) { Method match = add . get ( additional ) ; if ( isMatching ( method , match ) ) { return additional ; } } return null ;
public class MAP { /** * Method to return the AP ( average precision ) value at a particular cutoff * level for a given user . * @ param user the user * @ param at cutoff level * @ return the AP ( average precision ) corresponding to the requested user at * the cutoff level */ @ Override public double getValu...
if ( userMAPAtCutoff . containsKey ( at ) && userMAPAtCutoff . get ( at ) . containsKey ( user ) ) { double map = userMAPAtCutoff . get ( at ) . get ( user ) ; return map ; } return Double . NaN ;
public class StaxClientConfiguration { /** * Bootstrap mechanism that loads the configuration for the client object based * on the specified configuration reading mechanism . * The reference implementation of the configuration is XML - based , but this interface * allows for whatever mechanism is desired * @ pa...
ClientConfiguration configuration = configurationReader . read ( ) ; return configuration ;
public class ZoomablePane { /** * Replies the property that indicates the sensibility of the panning moves . * The sensibility is a strictly positive number that is multiplied to the * distance covered by the mouse motion for obtaining the move to * apply to the document . * The default value is 1. * @ return...
if ( this . panSensitivity == null ) { this . panSensitivity = new StyleableDoubleProperty ( DEFAULT_PAN_SENSITIVITY ) { @ Override public void invalidated ( ) { if ( get ( ) <= MIN_PAN_SENSITIVITY ) { set ( MIN_PAN_SENSITIVITY ) ; } } @ Override public CssMetaData < ZoomablePane < ? > , Number > getCssMetaData ( ) { r...
public class Trigger { /** * Returns a subset of { @ link TriggerDescriptor } s that applys to the given item . */ public static List < TriggerDescriptor > for_ ( Item i ) { } }
List < TriggerDescriptor > r = new ArrayList < > ( ) ; for ( TriggerDescriptor t : all ( ) ) { if ( ! t . isApplicable ( i ) ) continue ; if ( i instanceof TopLevelItem ) { // ugly TopLevelItemDescriptor tld = ( ( TopLevelItem ) i ) . getDescriptor ( ) ; // tld shouldn ' t be really null in contract , but we often writ...
public class JMJson { /** * With rest or file path or classpath t . * @ param < T > the type parameter * @ param resourceRestOrFilePathOrClasspath the resource rest or file path or classpath * @ param typeReference the type reference * @ return the t */ public static < T > T withRestOrFilePathOrClasspath ( Stri...
return withJsonString ( JMRestfulResource . getStringWithRestOrFilePathOrClasspath ( resourceRestOrFilePathOrClasspath ) , typeReference ) ;
public class ByteUtils { /** * Compare a byte array ( b1 ) with a sub * @ param b1 The first array * @ param b2 The second array * @ param offset The offset in b2 from which to compare * @ param to The least offset in b2 which we don ' t compare * @ return - 1 if b1 < b2 , 1 if b1 > b2 , and 0 if they are equ...
int j = offset ; int b2Length = to - offset ; if ( to > b2 . length ) throw new IllegalArgumentException ( "To offset (" + to + ") should be <= than length (" + b2 . length + ")" ) ; for ( int i = 0 ; i < b1 . length && j < to ; i ++ , j ++ ) { int a = ( b1 [ i ] & 0xff ) ; int b = ( b2 [ j ] & 0xff ) ; if ( a != b ) {...
public class GreenMailUtil { /** * Create new multipart with a text part and an attachment * @ param msg Message text * @ param attachment Attachment data * @ param contentType MIME content type of body * @ param filename File name of the attachment * @ param description Description of the attachment * @ re...
try { MimeMultipart multiPart = new MimeMultipart ( ) ; MimeBodyPart textPart = new MimeBodyPart ( ) ; multiPart . addBodyPart ( textPart ) ; textPart . setText ( msg ) ; MimeBodyPart binaryPart = new MimeBodyPart ( ) ; multiPart . addBodyPart ( binaryPart ) ; DataSource ds = new DataSource ( ) { @ Override public Inpu...
public class GeometryExpression { /** * / * ( non - Javadoc ) * @ see com . querydsl . core . types . dsl . SimpleExpression # eq ( com . querydsl . core . types . Expression ) */ @ Override public BooleanExpression eq ( Expression < ? super T > right ) { } }
return Expressions . booleanOperation ( SpatialOps . EQUALS , mixin , right ) ;
public class ByteArrayWriter { /** * Encode an integer into a 4 byte array . * @ param i * @ return a byte [ 4 ] containing the encoded integer . */ public static byte [ ] encodeInt ( int i ) { } }
byte [ ] raw = new byte [ 4 ] ; raw [ 0 ] = ( byte ) ( i >> 24 ) ; raw [ 1 ] = ( byte ) ( i >> 16 ) ; raw [ 2 ] = ( byte ) ( i >> 8 ) ; raw [ 3 ] = ( byte ) ( i ) ; return raw ;
public class CommandLineArgumentParser { /** * Expand any collection value that references a filename that ends in one of the accepted expansion * extensions , and add the contents of the file to the list of values for that argument . * @ param argumentDefinition ArgumentDefinition for the arg being populated * @...
List < String > expandedValues = new ArrayList < > ( ) ; if ( EXPANSION_FILE_EXTENSIONS . stream ( ) . anyMatch ( ext -> stringValue . endsWith ( ext ) ) ) { // If any value provided for this argument is an expansion file , expand it in place , // but preserve the original values for subsequent retrieval during command...
public class RetentionSet { /** * Find retention record on or before the given time . * @ param time time * @ return reference record which is greatest lower bound for given time . It returns null if no such record exists in the set . */ public StreamCutReferenceRecord findStreamCutReferenceForTime ( long time ) { ...
int beforeIndex = getGreatestLowerBound ( this , time , StreamCutReferenceRecord :: getRecordingTime ) ; if ( beforeIndex < 0 ) { return null ; } return retentionRecords . get ( beforeIndex ) ;
public class CmsDriverManager { /** * Return a cache key build from the provided information . < p > * @ param prefix a prefix for the key * @ param flag a boolean flag for the key ( only used if prefix is not null ) * @ param projectId the project for which to generate the key * @ param resource the resource f...
StringBuffer b = new StringBuffer ( 64 ) ; if ( prefix != null ) { b . append ( prefix ) ; b . append ( flag ? '+' : '-' ) ; } b . append ( CmsProject . isOnlineProject ( projectId ) ? '+' : '-' ) ; return b . append ( resource ) . toString ( ) ;
public class JSONArray { /** * 将JSON内容写入Writer * @ param writer writer * @ param indentFactor 缩进因子 , 定义每一级别增加的缩进量 * @ param indent 本级别缩进量 * @ return Writer * @ throws IOException IO相关异常 */ private Writer doWrite ( Writer writer , int indentFactor , int indent ) throws IOException { } }
writer . write ( CharUtil . BRACKET_START ) ; final int newindent = indent + indentFactor ; final boolean isIgnoreNullValue = this . config . isIgnoreNullValue ( ) ; boolean isFirst = true ; for ( Object obj : this . rawList ) { if ( ObjectUtil . isNull ( obj ) && isIgnoreNullValue ) { continue ; } if ( isFirst ) { isF...
public class WebserviceDescriptionMetaData { /** * Serialize as a String * @ return string */ public String serialize ( ) { } }
StringBuilder buffer = new StringBuilder ( "<webservice-description>" ) ; buffer . append ( "<webservice-description-name>" ) . append ( webserviceDescriptionName ) . append ( "</webservice-description-name>" ) ; buffer . append ( "<wsdl-file>" ) . append ( wsdlFile ) . append ( "</wsdl-file>" ) ; buffer . append ( "<j...
public class RotationAxis { /** * Returns the rotation axis and angle in a single javax . vecmath . AxisAngle4d object * @ return */ public AxisAngle4d getAxisAngle4d ( ) { } }
return new AxisAngle4d ( rotationAxis . getX ( ) , rotationAxis . getY ( ) , rotationAxis . getZ ( ) , theta ) ;
public class FldExporter { /** * Parses the string into a list of values unless the string starts with ` # ` * @ param values is a space - separated set of values * @ return a vector of values */ public List < Double > parse ( String values ) { } }
List < Double > inputValues = new ArrayList < Double > ( ) ; if ( ! ( values . isEmpty ( ) || values . charAt ( 0 ) == '#' ) ) { StringTokenizer tokenizer = new StringTokenizer ( values ) ; while ( tokenizer . hasMoreTokens ( ) ) { inputValues . add ( Op . toDouble ( tokenizer . nextToken ( ) ) ) ; } } return inputValu...
public class current_timezone { /** * Use this API to fetch filtered set of current _ timezone resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static current_timezone [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
current_timezone obj = new current_timezone ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; current_timezone [ ] response = ( current_timezone [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class RuleModel { /** * Add metaData * @ param metadata */ public void addMetadata ( final RuleMetadata metadata ) { } }
final RuleMetadata [ ] newList = new RuleMetadata [ this . metadataList . length + 1 ] ; for ( int i = 0 ; i < this . metadataList . length ; i ++ ) { newList [ i ] = this . metadataList [ i ] ; } newList [ this . metadataList . length ] = metadata ; this . metadataList = newList ;
public class UIContainer { /** * Gets the { @ link UIComponent } matching the specified name . If recursive is true , looks for the { @ code UIComponent } inside it child * { @ link UIContainer } too . * @ param name the name * @ param recursive if true , look inside child { @ code UIContainer } * @ return the ...
if ( StringUtils . isEmpty ( name ) ) return null ; for ( UIComponent c : content . components ) { if ( name . equals ( c . getName ( ) ) ) return c ; } if ( ! recursive ) return null ; for ( UIComponent c : content . components ) { if ( c instanceof UIContainer ) { UIComponent found = getComponent ( name , true ) ; if...
public class FileUtils { /** * Tell whether a string ends with a particular suffix , with case sensitivity determined by the operating system . * @ param str the String to test . * @ param suffix the suffix to look for . * @ return < code > true < / code > when : * < ul > * < li > < code > str < / code > ends...
if ( OS_CASE_SENSITIVE ) { return str . endsWith ( suffix ) ; } else { int strLen = str . length ( ) ; int suffixLen = suffix . length ( ) ; if ( strLen < suffixLen ) { return false ; } return ( str . substring ( strLen - suffixLen ) . equalsIgnoreCase ( suffix ) ) ; }
public class SslCertificateUtils { /** * Tells whether or not the given ( { @ code . pem } file ) contents contain a section with the given begin and end tokens . * @ param contents the ( { @ code . pem } file ) contents to check if contains the section . * @ param beginToken the begin token of the section . * @ ...
int idxToken ; if ( ( idxToken = contents . indexOf ( beginToken ) ) == - 1 || contents . indexOf ( endToken ) < idxToken ) { return false ; } return true ;
public class SGraphPoint { /** * Add the given segments in the connection . * @ param segments the segments to add . */ void add ( Iterable < SGraphSegment > segments ) { } }
for ( final SGraphSegment segment : segments ) { this . segments . add ( segment ) ; }