signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RamLruCache { /** * Remove the eldest entries until the total of remaining entries is at or * below the requested size . * @ param maxSize the maximum size of the cache before returning . May be - 1 * to evict even 0 - sized elements . */ public void trimToSize ( int maxSize ) { } }
while ( true ) { K key ; V value ; synchronized ( this ) { if ( size < 0 || ( map . isEmpty ( ) && size != 0 ) ) { throw new IllegalStateException ( getClass ( ) . getName ( ) + ".sizeOf() is reporting inconsistent results!" ) ; } if ( size <= maxSize ) { break ; } Map . Entry < K , V > toEvict = null ; try { toEvict =...
public class BpmnXMLUtil { /** * add all attributes from XML to element extensionAttributes ( except blackListed ) . * @ param xtr * @ param element * @ param blackLists */ public static void addCustomAttributes ( XMLStreamReader xtr , BaseElement element , List < ExtensionAttribute > ... blackLists ) { } }
for ( int i = 0 ; i < xtr . getAttributeCount ( ) ; i ++ ) { ExtensionAttribute extensionAttribute = new ExtensionAttribute ( ) ; extensionAttribute . setName ( xtr . getAttributeLocalName ( i ) ) ; extensionAttribute . setValue ( xtr . getAttributeValue ( i ) ) ; if ( StringUtils . isNotEmpty ( xtr . getAttributeNames...
public class FNCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setXftUnits ( Integer newXftUnits ) { } }
Integer oldXftUnits = xftUnits ; xftUnits = newXftUnits ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FNC__XFT_UNITS , oldXftUnits , xftUnits ) ) ;
public class EventDataObjectDeserializer { /** * Safe deserialize raw JSON into { @ code StripeObject } . This operation mutates the state , and the * successful result can be accessed via { @ link EventDataObjectDeserializer # getObject ( ) } . * Matching { @ link Event # getApiVersion ( ) } and { @ link Stripe # ...
if ( ! apiVersionMatch ( ) ) { // when version mismatch , even when deserialization is successful , // we cannot guarantee data correctness . Old events containing fields that should be // translated / mapped to the new schema will simply not be captured by the new schema . return false ; } else if ( object != null ) {...
public class DoubleUtils { /** * Returns the index of the first minimal element of the array within the specified bounds . That * is , if there is a unique minimum , its index is returned . If there are multiple values tied for * smallest , the index of the first is returned . If the supplied array is empty , an { ...
checkArgument ( endExclusive > startInclusive ) ; checkArgument ( startInclusive >= 0 ) ; checkArgument ( endExclusive <= x . length ) ; double minValue = Double . MAX_VALUE ; int minIndex = 0 ; for ( int i = startInclusive ; i < endExclusive ; ++ i ) { final double val = x [ i ] ; if ( val < minValue ) { minIndex = i ...
public class EurekaClinicalClient { /** * Makes a POST call to the specified path . * @ param path the path to call . * @ throws ClientException if a status code other than 200 ( OK ) and 204 ( No * Content ) is returned . */ protected void doPost ( String path ) throws ClientException { } }
this . readLock . lock ( ) ; try { ClientResponse response = getResourceWrapper ( ) . rewritten ( path , HttpMethod . POST ) . post ( ClientResponse . class ) ; errorIfStatusNotEqualTo ( response , ClientResponse . Status . OK , ClientResponse . Status . NO_CONTENT ) ; response . close ( ) ; } catch ( ClientHandlerExce...
public class Functions { /** * Transforms the { @ link EntityID } to a { @ link UUID } supplier . * @ param id * ID annotation . * @ return ID supplier using annotation . * @ see # validateEntityID ( EntityID ) */ public static Supplier < UUID > toIDSupplier ( final EntityID id ) { } }
validateEntityID ( id ) ; // Random supplier if ( id . random ( ) ) { return RANDOM_ID_SUPPLIER ; } // Create ID final UUID newID ; if ( id . name ( ) . length ( ) > 0 ) { newID = UUID . fromString ( id . name ( ) ) ; } else { newID = new UUID ( id . mostSigBits ( ) , id . leastSigBits ( ) ) ; } // Create static ID sup...
public class SharesInner { /** * Refreshes the share metadata with the data from the cloud . * @ param deviceName The device name . * @ param name The share name . * @ param resourceGroupName The resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws Clou...
beginRefreshWithServiceResponseAsync ( deviceName , name , resourceGroupName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ServiceDiscoveryRunnable { /** * Trigger the loop every time enough ticks have been accumulated , or whenever any of the * visitors requests it . */ @ Override public long determineCurrentGeneration ( final AtomicLong generation , final long tick ) { } }
// If the scan interval was reached , trigger the // run . if ( tick - lastScan >= scanTicks ) { lastScan = tick ; return generation . incrementAndGet ( ) ; } // Otherwise , give the service discovery serviceDiscoveryVisitors a chance // to increment the generation . for ( ServiceDiscoveryTask visitor : visitors ) { vi...
public class SampleEventsProcessor { /** * Do simple validation before processing . * @ param event to validate */ private void validateEvent ( CloudTrailEvent event ) { } }
if ( event . getEventData ( ) . getAccountId ( ) == null ) { logger . error ( String . format ( "Event %s doesn't have account ID." , event . getEventData ( ) ) ) ; } // more validation here . . .
public class MicrochipPotentiometerBase { /** * Updates the cache to the wiper ' s value . * @ return The wiper ' s current value * @ throws IOException Thrown if communication fails or device returned a malformed result */ @ Override public int updateCacheFromDevice ( ) throws IOException { } }
currentValue = controller . getValue ( DeviceControllerChannel . valueOf ( channel ) , false ) ; return currentValue ;
public class HistoryReference { /** * ZAP : Support for multiple tags */ public void addTag ( String tag ) { } }
if ( insertTagDb ( tag ) ) { this . tags . add ( tag ) ; notifyEvent ( HistoryReferenceEventPublisher . EVENT_TAG_ADDED ) ; }
public class ArrayUtils { /** * Returns an { @ link Enumeration } enumerating over the elements in the array . * @ param < T > Class type of the elements in the array . * @ param array array to enumerate . * @ return an { @ link Enumeration } over the elements in the array or an empty { @ link Enumeration } * i...
return ( array == null ? Collections . emptyEnumeration ( ) : new Enumeration < T > ( ) { private int index = 0 ; @ Override public boolean hasMoreElements ( ) { return ( index < array . length ) ; } @ Override public T nextElement ( ) { Assert . isTrue ( hasMoreElements ( ) , new NoSuchElementException ( "No more elem...
public class FullDemo { /** * createDemoButtons , This creates the buttons for the demo , adds an action listener to each * button , and adds each button to the display panel . */ private static void createDemoButtons ( ) { } }
JPanel buttonPanel = new JPanel ( new WrapLayout ( ) ) ; panel . scrollPaneForButtons . setViewportView ( buttonPanel ) ; // Create each demo button , and add it to the panel . // Add an action listener to link it to its appropriate function . JButton showIntro = new JButton ( "Show Introduction Message" ) ; showIntro ...
public class JSLocalConsumerPoint { /** * Update the max active messages field * Set by the MessagePump class to indicate that there has been an update * in the Threadpool class . * WARNING : if the max is ever set to zero ( now or on registration ) then counting * is disabled ( for performance ) , so if it eve...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setMaxActiveMessages" , Integer . valueOf ( maxActiveMessages ) ) ; synchronized ( _asynchConsumerBusyLock ) { this . lock ( ) ; try { synchronized ( _maxActiveMessageLock ) { // If the new value is > previous value and // ...
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1215:1 : primary : ( parExpression | nonWildcardTypeArguments ( explicitGenericInvocationSuffix | ' this ' arguments ) | ' this ' ( ' . ' Identifier ) * ( identifierSuffix ) ? | ' super ' superSuffi...
int primary_StartIndex = input . index ( ) ; Token i = null ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 127 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1216:5 : ( parExpression | nonWildcardTypeArguments ( explicitGenericInvocati...
public class HttpFields { /** * Get field value without parameters . Some field values can have * parameters . This method separates the value from the parameters and * optionally populates a map with the parameters . For example : * < PRE > * FieldName : Value ; param1 = val1 ; param2 = val2 * < / PRE > * ...
if ( value == null ) return null ; int i = value . indexOf ( ';' ) ; if ( i < 0 ) return value ; return value . substring ( 0 , i ) . trim ( ) ;
public class BoxPlot { /** * Little test program */ public static void main ( String [ ] argv ) throws IOException { } }
final File outputDir = new File ( argv [ 0 ] ) ; final Random rand = new Random ( ) ; final double mean1 = 5.0 ; final double mean2 = 7.0 ; final double dev1 = 2.0 ; final double dev2 = 4.0 ; final double [ ] data1 = new double [ 100 ] ; final double [ ] data2 = new double [ 100 ] ; for ( int i = 0 ; i < 100 ; ++ i ) {...
public class DateFormat { /** * Gets the date formatter with the given formatting style * for the default locale . * @ param style the given formatting style . For example , * SHORT for " M / d / yy " in the US locale . * @ return a date formatter . */ public final static DateFormat getDateInstance ( int style ...
return get ( 0 , style , 2 , Locale . getDefault ( Locale . Category . FORMAT ) ) ;
public class AggregationDistinctQueryResult { /** * Divide one distinct query result to multiple child ones . * @ return multiple child distinct query results */ @ Override public List < DistinctQueryResult > divide ( ) { } }
return Lists . newArrayList ( Iterators . transform ( getResultData ( ) , new Function < QueryRow , DistinctQueryResult > ( ) { @ Override public DistinctQueryResult apply ( final QueryRow input ) { Set < QueryRow > resultData = new LinkedHashSet < > ( ) ; resultData . add ( input ) ; return new AggregationDistinctQuer...
public class LinkType { /** * Checks whether a link reference can be handled by this link type * @ param linkRequest Link reference * @ return true if this link type can handle the given link reference */ @ SuppressWarnings ( "null" ) public boolean accepts ( @ NotNull LinkRequest linkRequest ) { } }
ValueMap props = linkRequest . getResourceProperties ( ) ; // check for matching link type ID in link resource String linkTypeId = props . get ( LinkNameConstants . PN_LINK_TYPE , String . class ) ; if ( StringUtils . isNotEmpty ( linkTypeId ) ) { return StringUtils . equals ( linkTypeId , getId ( ) ) ; } // if not lin...
public class ZkKeyValueCacheUtil { /** * 设置分布式缓存的值 , 不建议高频次地对同一个key进行设置操作 。 * 只适合读频繁但写入少的场景 * todo Not tested * @ throws CacheLockedException 如果其他人正在写入该值 , 则禁止你写入 . */ public static void blockingSet ( String subPath , String data ) throws CacheLockedException { } }
if ( data == null ) { data = "" ; } String fullPath = getFullPath ( subPath ) ; /* Integer innerLockId = DistZkLocker . lock ( ZkKeyValueCacheUtil . class . getName ( ) + " - lock : " + fullPath . replace ( " / " , " _ " ) , 0) . onErrorResumeNext ( timeoutException - > { / / 遇到锁则直接超时不执行 return Single . error (...
public class AVIMConversationEventHandler { /** * 对话成员信息变更通知 。 * 常见的有 : 某成员权限发生变化 ( 如 , 被设为管理员等 ) 。 * @ param client 通知关联的 AVIMClient * @ param conversation 通知关联的对话 * @ param memberInfo 变更后的成员信息 * @ param updatedProperties 发生变更的属性列表 ( 当前固定为 " role " ) * @ param operator 操作者 id */ public void onMemberInfoUpd...
LOGGER . d ( "Notification --- " + operator + " updated memberInfo: " + memberInfo . toString ( ) ) ;
public class DateTimeUtils { /** * Calculate the start - of - day point of a supplied { @ link Calendar } . * The returned { @ link Calendar } has its fields unsynced . Note : if { @ code origin } has * unsynced field , it may cause side - effect . * @ param origin * @ return */ public static Calendar startOfDa...
Calendar cal = ( Calendar ) origin . clone ( ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . set ( Calendar . HOUR_OF_DAY , 0 ) ; return cal ;
public class DateUtils { /** * 添加秒 * @ param date 日期 * @ param amount 数量 * @ return 添加后的日期 */ public static Date addSecond ( Date date , int amount ) { } }
return add ( date , Calendar . SECOND , amount ) ;
public class ChecksumFileSystem { /** * The src file is under FS , and the dst is on the local disk . * Copy it from FS control to the local dst name . * If src and dst are directories , the copyCrc parameter * determines whether to copy CRC files . */ public void copyToLocalFile ( Path src , Path dst , boolean c...
if ( ! fs . isDirectory ( src ) ) { // source is a file fs . copyToLocalFile ( src , dst ) ; FileSystem localFs = getLocal ( getConf ( ) ) . getRawFileSystem ( ) ; if ( localFs . isDirectory ( dst ) ) { dst = new Path ( dst , src . getName ( ) ) ; } dst = getChecksumFile ( dst ) ; if ( localFs . exists ( dst ) ) { // r...
public class RESTMBeanServerConnection { /** * { @ inheritDoc } */ @ Override public ObjectInstance createMBean ( String className , ObjectName name , ObjectName loaderName ) throws ReflectionException , InstanceAlreadyExistsException , MBeanRegistrationException , MBeanException , NotCompliantMBeanException , Instance...
return createMBean ( className , name , loaderName , null , null , true , false ) ;
public class ServerHandshaker { /** * Retrieve the Kerberos key for the specified server principal * from the JAAS configuration file . * @ return true if successful , false if not available or invalid */ private boolean setupKerberosKeys ( ) { } }
if ( kerberosKeys != null ) { return true ; } try { final AccessControlContext acc = getAccSE ( ) ; kerberosKeys = AccessController . doPrivileged ( // Eliminate dependency on KerberosKey new PrivilegedExceptionAction < SecretKey [ ] > ( ) { public SecretKey [ ] run ( ) throws Exception { // get kerberos key for the de...
public class OpenJPAEnhancerMojo { /** * Notifies the watcher that a new file is created . * @ param file is the file . * @ return { @ literal false } if the pipeline processing must be interrupted for this event . Most watchers should * return { @ literal true } to let other watchers be notified . * @ throws o...
try { List < File > entities = findEntityClassFiles ( ) ; enhance ( entities ) ; return true ; } catch ( MojoExecutionException e ) { throw new WatchingException ( "OpenJPA Enhancer" , "Error while enhancing JPA entities" , file , e ) ; }
public class AbstractImageGL { /** * Draws this image with the supplied transform , and source and target dimensions . */ void draw ( GLShader shader , InternalTransform xform , int tint , float dx , float dy , float dw , float dh , float sx , float sy , float sw , float sh ) { } }
float texWidth = width ( ) , texHeight = height ( ) ; drawImpl ( shader , xform , ensureTexture ( ) , tint , dx , dy , dw , dh , sx / texWidth , sy / texHeight , ( sx + sw ) / texWidth , ( sy + sh ) / texHeight ) ;
public class StringMatcher { /** * Implement UnicodeMatcher */ @ Override public int matches ( Replaceable text , int [ ] offset , int limit , boolean incremental ) { } }
// Note ( 1 ) : We process text in 16 - bit code units , rather than // 32 - bit code points . This works because stand - ins are // always in the BMP and because we are doing a literal match // operation , which can be done 16 - bits at a time . int i ; int [ ] cursor = new int [ ] { offset [ 0 ] } ; if ( limit < curs...
public class NextUtil { /** * Rename images so that their name is unique */ public static ro . nextreports . server . domain . Report renameImagesAsUnique ( ro . nextreports . server . domain . Report report ) { } }
NextContent reportContent = ( NextContent ) report . getContent ( ) ; try { String masterContent = new String ( reportContent . getNextFile ( ) . getDataProvider ( ) . getBytes ( ) , "UTF-8" ) ; for ( JcrFile imageFile : reportContent . getImageFiles ( ) ) { String oldName = imageFile . getName ( ) ; int index = oldNam...
public class Phaser { /** * Main implementation for methods arrive and arriveAndDeregister . * Manually tuned to speed up and minimize race windows for the * common case of just decrementing unarrived field . * @ param adjust value to subtract from state ; * ONE _ ARRIVAL for arrive , * ONE _ DEREGISTER for a...
final Phaser root = this . root ; for ( ; ; ) { long s = ( root == this ) ? state : reconcileState ( ) ; int phase = ( int ) ( s >>> PHASE_SHIFT ) ; if ( phase < 0 ) return phase ; int counts = ( int ) s ; int unarrived = ( counts == EMPTY ) ? 0 : ( counts & UNARRIVED_MASK ) ; if ( unarrived <= 0 ) throw new IllegalSta...
public class Parser { /** * Converts JDBC - specific callable statement escapes { @ code { [ ? = ] call < some _ function > [ ( ? , * [ ? , . . ] ) ] } } into the PostgreSQL format which is { @ code select < some _ function > ( ? , [ ? , . . . ] ) as * result } or { @ code select * from < some _ function > ( ? , [ ...
// Mini - parser for JDBC function - call syntax ( only ) // TODO : Merge with escape processing ( and parameter parsing ? ) so we only parse each query once . // RE : frequently used statements are cached ( see { @ link org . postgresql . jdbc . PgConnection # borrowQuery } ) , so this " merge " is not that important ...
public class DefaultDelegationProvider { /** * Creates the application to security roles mapping for a given application . * @ param appName the name of the application for which the mappings belong to . * @ param securityRoles the security roles of the application . */ public void createAppToSecurityRolesMapping (...
// only add it if we don ' t have a cached copy appToSecurityRolesMap . putIfAbsent ( appName , securityRoles ) ;
public class UnrelatedCollectionContents { /** * adds this item ' s type and all of it ' s superclass / interfaces to the set of possible types that could define this added item * @ param supers * the current set of superclass items * @ param addItm * the item we are adding * @ throws ClassNotFoundException ...
String itemSignature = addItm . getSignature ( ) ; if ( itemSignature . length ( ) == 0 ) { return ; } if ( itemSignature . startsWith ( Values . SIG_ARRAY_PREFIX ) ) { supers . add ( itemSignature ) ; return ; } JavaClass cls = addItm . getJavaClass ( ) ; if ( ( cls == null ) || Values . DOTTED_JAVA_LANG_OBJECT . equa...
public class ThymeleafFactory { /** * Constructs the template engine . * @ param templateResolver The template resolver * @ param engineContextFactory The engine context factory * @ param linkBuilder The link builder * @ return The template engine */ @ Singleton public TemplateEngine templateEngine ( ITemplateR...
TemplateEngine engine = new TemplateEngine ( ) ; engine . setEngineContextFactory ( engineContextFactory ) ; engine . setLinkBuilder ( linkBuilder ) ; engine . setTemplateResolver ( templateResolver ) ; return engine ;
public class NameConstraintsExtension { /** * Recalculate hasMin and hasMax flags . */ private void calcMinMax ( ) throws IOException { } }
hasMin = false ; hasMax = false ; if ( excluded != null ) { for ( int i = 0 ; i < excluded . size ( ) ; i ++ ) { GeneralSubtree subtree = excluded . get ( i ) ; if ( subtree . getMinimum ( ) != 0 ) hasMin = true ; if ( subtree . getMaximum ( ) != - 1 ) hasMax = true ; } } if ( permitted != null ) { for ( int i = 0 ; i ...
public class PebbleDictionary { /** * Returns the unsigned integer as a long to which the specified key is mapped , or null if the key does not exist in this * dictionary . We are using the Long type here so that we can remove the guava dependency . This is done so that we dont * have incompatibility issues with th...
PebbleTuple tuple = getTuple ( key , PebbleTuple . TupleType . UINT ) ; if ( tuple == null ) { return null ; } return ( Long ) tuple . value ;
public class MeterUsageRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MeterUsageRequest meterUsageRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( meterUsageRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( meterUsageRequest . getProductCode ( ) , PRODUCTCODE_BINDING ) ; protocolMarshaller . marshall ( meterUsageRequest . getTimestamp ( ) , TIMESTAMP_BINDING ) ; protocolM...
public class Utility { /** * Prepares the list of Files and Folders inside ' inter ' Directory . * The list can be filtered through extensions . ' filter ' reference * is the FileFilter . A reference of ArrayList is passed , in case it * may contain the ListItem for parent directory . Returns the List of * Dire...
try { // Check for each and every directory / file in ' inter ' directory . // Filter by extension using ' filter ' reference . for ( File name : inter . listFiles ( filter ) ) { // If file / directory can be read by the Application if ( name . canRead ( ) ) { // Create a row item for the directory list and define prop...
public class QrCodeDecoderBits { /** * Decodes Kanji messages * @ param qr QR code * @ param data encoded data * @ return Location it has read up to in bits */ private int decodeKanji ( QrCode qr , PackedBits8 data , int bitLocation ) { } }
int lengthBits = QrCodeEncoder . getLengthBitsKanji ( qr . version ) ; int length = data . read ( bitLocation , lengthBits , true ) ; bitLocation += lengthBits ; byte rawdata [ ] = new byte [ length * 2 ] ; for ( int i = 0 ; i < length ; i ++ ) { if ( data . size < bitLocation + 13 ) { qr . failureCause = QrCode . Fail...
public class AttributeService { /** * Set editable state on an attribute . This needs to also set the state on the associated attributes . * @ param attribute attribute for which the editable state needs to be set * @ param editable new editable state */ public void setAttributeEditable ( Attribute attribute , bool...
attribute . setEditable ( editable ) ; if ( ! ( attribute instanceof LazyAttribute ) ) { // should not instantiate lazy attributes ! if ( attribute instanceof ManyToOneAttribute ) { setAttributeEditable ( ( ( ManyToOneAttribute ) attribute ) . getValue ( ) , editable ) ; } else if ( attribute instanceof OneToManyAttrib...
public class FixedBucketsHistogram { /** * Serialize the histogram in sparse encoding mode . * The serialization header is always written , since the sparse encoding is only used in situations where the * header is required . * @ param nonEmptyBuckets Number of non - empty buckets in the histogram * @ return Se...
int size = SERDE_HEADER_SIZE + getSparseStorageSize ( nonEmptyBuckets ) ; ByteBuffer buf = ByteBuffer . allocate ( size ) ; writeByteBufferSparse ( buf , nonEmptyBuckets ) ; return buf . array ( ) ;
public class PortletExecutionManager { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . portlet . rendering . IPortletExecutionManager # getPortletHeadOutput ( org . apereo . portal . portlet . om . IPortletWindowId , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletRespons...
if ( doesPortletNeedHeaderWorker ( portletWindowId , request ) ) { final IPortletRenderExecutionWorker tracker = getRenderedPortletHeaderWorker ( portletWindowId , request , response ) ; final long timeout = getPortletRenderTimeout ( portletWindowId , request ) ; try { final String output = tracker . getOutput ( timeou...
public class Curve25519 { /** * / * Multiply two numbers . The output is in reduced form , the inputs need not * be . */ private static final long10 mul ( long10 xy , long10 x , long10 y ) { } }
/* sahn0: * Using local variables to avoid class access . * This seem to improve performance a bit . . . */ long x_0 = x . _0 , x_1 = x . _1 , x_2 = x . _2 , x_3 = x . _3 , x_4 = x . _4 , x_5 = x . _5 , x_6 = x . _6 , x_7 = x . _7 , x_8 = x . _8 , x_9 = x . _9 ; long y_0 = y . _0 , y_1 = y . _1 , y_2 = y . _2 , y_3...
public class PutSlotTypeResult { /** * A list of < code > EnumerationValue < / code > objects that defines the values that the slot type can take . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEnumerationValues ( java . util . Collection ) } or { @ link...
if ( this . enumerationValues == null ) { setEnumerationValues ( new java . util . ArrayList < EnumerationValue > ( enumerationValues . length ) ) ; } for ( EnumerationValue ele : enumerationValues ) { this . enumerationValues . add ( ele ) ; } return this ;
public class ToolScreen { /** * Override this to add your tool buttons . */ public void setupEndSFields ( ) { } }
new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . HELP ) ;
public class GVRSceneObject { /** * Generate debug dump of the tree from the scene object . * It should include a newline character at the end . * @ param sb the { @ code StringBuffer } to dump the object . * @ param indent indentation level as number of spaces . */ public void prettyPrint ( StringBuffer sb , int...
sb . append ( Log . getSpaces ( indent ) ) ; sb . append ( getClass ( ) . getSimpleName ( ) ) ; sb . append ( " [name=" ) ; sb . append ( this . getName ( ) ) ; sb . append ( "]" ) ; sb . append ( System . lineSeparator ( ) ) ; GVRRenderData rdata = getRenderData ( ) ; GVRTransform trans = getTransform ( ) ; if ( rdata...
public class Criteria { /** * Retrieves or if necessary , creates a user alias to be used * by a child criteria * @ param attribute The alias to set */ private UserAlias getUserAlias ( Object attribute ) { } }
if ( m_userAlias != null ) { return m_userAlias ; } if ( ! ( attribute instanceof String ) ) { return null ; } if ( m_alias == null ) { return null ; } if ( m_aliasPath == null ) { boolean allPathsAliased = true ; return new UserAlias ( m_alias , ( String ) attribute , allPathsAliased ) ; } return new UserAlias ( m_ali...
public class CatchThrowable { /** * Use it to catch an throwable and to get access to the thrown throwable ( for further verifications ) . * In the following example you catch throwables that are thrown by obj . doX ( ) : * < code > catchThrowable ( obj ) . doX ( ) ; / / catch * if ( caughtThrowable ( ) ! = null ...
validateArguments ( actor , Throwable . class ) ; catchThrowable ( actor , Throwable . class , false ) ;
public class MapContext { /** * Get the array of all keys that provide valid sub - maps and descendents . * For example , a property map containing " test . one " , " users . nick " , * " users . john " will result in two keys : " test " and " users " . * @ param map The property map to retrieve from * @ return...
String [ ] result = null ; Set < ? > keySet = map . subMapKeySet ( ) ; int keySize = keySet . size ( ) ; if ( keySize > 0 ) { result = keySet . toArray ( new String [ keySize ] ) ; } return result ;
public class Binder { /** * Process the incoming arguments by calling the given static method on the * given class , inserting the result as the first argument . * @ param lookup the java . lang . invoke . MethodHandles . Lookup to use * @ param target the class on which the method is defined * @ param method t...
return fold ( Binder . from ( type ( ) ) . invokeStaticQuiet ( lookup , target , method ) ) ;
public class RelationsCrud { /** * Add the spouses in husband / wife order . * @ param newFamily the family to modify * @ param spouseAttribute the spouse to add */ protected final void addSpouseAttribute ( final ApiFamily newFamily , final ApiAttribute spouseAttribute ) { } }
if ( "husband" . equals ( spouseAttribute . getType ( ) ) ) { newFamily . getSpouses ( ) . add ( 0 , spouseAttribute ) ; } else { newFamily . getSpouses ( ) . add ( spouseAttribute ) ; }
public class MjdbcPoolBinder { /** * Returns new Pooled { @ link DataSource } implementation * In case this function won ' t work - use { @ link # createDataSource ( java . util . Properties ) } * @ param driverClassName Driver Class name * @ param url Database connection url * @ param userName Database user na...
return createDataSource ( driverClassName , url , userName , password , 10 , 100 ) ;
public class Longs { /** * Converts a String into a Long by first parsing it as Double and then casting it to Long . * @ param s The String to convert , may be null or in decimal format * @ return The parsed Long or null when parsing is not possible */ public static Long parseDecimal ( final String s ) { } }
Long parsed = null ; try { if ( s != null ) { parsed = ( long ) Double . parseDouble ( s ) ; } } catch ( final NumberFormatException e ) { } return parsed ;
public class MultiMapLayer { /** * Fire the event that indicates all the layers were removed . * @ param removedObjects are the removed objects . */ protected void fireLayerRemoveAllEvent ( List < ? extends L > removedObjects ) { } }
fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , removedObjects , Type . REMOVE_ALL_CHILDREN , - 1 , isTemporaryLayer ( ) ) ) ;
public class AstaDatabaseReader { /** * Releases a database connection , and cleans up any resources * associated with that connection . */ private void releaseConnection ( ) { } }
if ( m_rs != null ) { try { m_rs . close ( ) ; } catch ( SQLException ex ) { // silently ignore errors on close } m_rs = null ; } if ( m_ps != null ) { try { m_ps . close ( ) ; } catch ( SQLException ex ) { // silently ignore errors on close } m_ps = null ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MultiSolidCoverageType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link MultiSolidCoverageType } ...
return new JAXBElement < MultiSolidCoverageType > ( _MultiSolidCoverage_QNAME , MultiSolidCoverageType . class , null , value ) ;
public class XForLoopExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetDeclaredParam ( JvmFormalParameter newDeclaredParam , NotificationChain msgs ) { } }
JvmFormalParameter oldDeclaredParam = declaredParam ; declaredParam = newDeclaredParam ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XbasePackage . XFOR_LOOP_EXPRESSION__DECLARED_PARAM , oldDeclaredParam , newDeclaredParam ) ; if ( msgs == null...
public class Processor { /** * Recursively process the given Block . * @ param root * The Block to process . * @ param listMode * Flag indicating that we ' re in a list item block . */ private void recurse ( final Block root , final boolean listMode ) { } }
Block block , list ; Line line = root . lines ; if ( listMode ) { root . removeListIndent ( this . config ) ; if ( this . useExtensions && root . lines != null && root . lines . getLineType ( this . config ) != LineType . CODE ) { root . id = root . lines . stripID ( ) ; } } while ( line != null && line . isEmpty ) { l...
public class XhtmlTemplateEngine { /** * Loads and parses template document then returns it . * @ param builder DOM builder used to load document template , * @ param reader template document reader . * @ throws IOException if read operation fails or premature EOF . * @ throws TemplateException if template docu...
final int READ_AHEAD_SIZE = 5 ; BufferedReader bufferedReader = new BufferedReader ( reader ) ; bufferedReader . mark ( READ_AHEAD_SIZE ) ; char [ ] cbuf = new char [ READ_AHEAD_SIZE ] ; for ( int i = 0 ; i < READ_AHEAD_SIZE ; ++ i ) { int c = bufferedReader . read ( ) ; if ( c == - 1 ) { throw new IOException ( String...
public class Formula { /** * Applies a given function on this formula and returns the result . * @ param function the function * @ param cache indicates whether the result should be cached in this formula ' s cache * @ param < T > the result type of the function * @ return the result of the function application...
return function . apply ( this , cache ) ;
public class EJBThreadData { /** * Restores the callback bean after removing the thread context established * by a previous call to { @ link # pushCallbackBeanO } . */ public void popCallbackBeanO ( ) // d662032 { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "popCallbackBeanO: " + ivCallbackBeanOStack . peek ( ) ) ; ivHandleListContext . endContext ( ) ; BeanO beanO = ivCallbackBeanOStack . pop ( ) ; beanO . parkHandleList ( ) ;
public class PatternBox { /** * Two proteins have states that are members of the same complex . Handles nested complexes and * homologies . Also guarantees that relationship to the complex is through different direct * complex members . * @ return pattern */ public static Pattern inComplexWith ( ) { } }
Pattern p = new Pattern ( SequenceEntityReference . class , "Protein 1" ) ; p . add ( linkedER ( true ) , "Protein 1" , "generic Protein 1" ) ; p . add ( erToPE ( ) , "generic Protein 1" , "SPE1" ) ; p . add ( linkToComplex ( ) , "SPE1" , "PE1" ) ; p . add ( new PathConstraint ( "PhysicalEntity/componentOf" ) , "PE1" ,...
public class WebJsJmsMessageEncoderImpl { /** * Encode a ' name = value ' pair */ private void encodePair ( StringBuffer result , String name , Object value , boolean first ) { } }
if ( ! first ) result . append ( '&' ) ; URLEncode ( result , name ) ; result . append ( '=' ) ; encodeObject ( result , value ) ;
public class StopSyncPRequest { /** * < code > optional . alluxio . grpc . file . StopSyncPOptions options = 2 ; < / code > */ public alluxio . grpc . StopSyncPOptionsOrBuilder getOptionsOrBuilder ( ) { } }
return options_ == null ? alluxio . grpc . StopSyncPOptions . getDefaultInstance ( ) : options_ ;
public class IssueManager { /** * DEPRECATED . use relation . delete ( ) */ @ Deprecated public void deleteIssueRelations ( Issue redmineIssue ) throws RedmineException { } }
for ( IssueRelation relation : redmineIssue . getRelations ( ) ) { deleteRelation ( relation . getId ( ) ) ; }
public class GobblinServiceJobScheduler { /** * { @ inheritDoc } */ @ Override public AddSpecResponse onAddSpec ( Spec addedSpec ) { } }
if ( this . helixManager . isPresent ( ) && ! this . helixManager . get ( ) . isConnected ( ) ) { // Specs in store will be notified when Scheduler is added as listener to FlowCatalog , so ignore // . . Specs if in cluster mode and Helix is not yet initialized _log . info ( "System not yet initialized. Skipping Spec Ad...
public class LinnaeusSpecies { /** * setter for allIdsString - sets This feature contains all possible NCBI Taxonomy IDs . * @ generated * @ param v value to set into the feature */ public void setAllIdsString ( String v ) { } }
if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_allIdsString == null ) jcasType . jcas . throwFeatMissing ( "allIdsString" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_allIdsStri...
public class Kryo { /** * Returns the best matching serializer for a class . This method can be overridden to implement custom logic to choose a * serializer . */ public Serializer getDefaultSerializer ( Class type ) { } }
if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; Serializer serializerForAnnotation = getDefaultSerializerForAnnotatedType ( type ) ; if ( serializerForAnnotation != null ) return serializerForAnnotation ; for ( int i = 0 , n = defaultSerializers . size ( ) ; i < n ; i ++ ) { DefaultS...
public class Matrix4f { /** * Set this matrix to be an asymmetric off - center perspective projection frustum transformation for a right - handed * coordinate system using the given NDC z range . * The given angles < code > offAngleX < / code > and < code > offAngleY < / code > are the horizontal and vertical angle...
MemUtil . INSTANCE . zero ( this ) ; float h = ( float ) Math . tan ( fovy * 0.5f ) ; float xScale = 1.0f / ( h * aspect ) , yScale = 1.0f / h ; this . _m00 ( xScale ) ; this . _m11 ( yScale ) ; float offX = ( float ) Math . tan ( offAngleX ) , offY = ( float ) Math . tan ( offAngleY ) ; this . _m20 ( offX * xScale ) ;...
public class EventManager { /** * Check if the event must be sent and fire it if must be done * @ param attributeName specified event attribute * @ param devFailed the attribute failed error to be sent as event * @ throws fr . esrf . Tango . DevFailed * @ throws DevFailed */ public void pushAttributeErrorEvent ...
xlogger . entry ( ) ; for ( final EventType eventType : EventType . values ( ) ) { final String fullName = EventUtilities . buildEventName ( deviceName , attributeName , eventType ) ; final EventImpl eventImpl = getEventImpl ( fullName ) ; if ( eventImpl != null ) { for ( ZMQ . Socket eventSocket : eventEndpoints . val...
public class CommandLineArgumentParser { /** * arguments involved . */ private void validateArgumentDefinitions ( ) { } }
for ( final NamedArgumentDefinition mutexSourceDef : namedArgumentDefinitions ) { for ( final String mutexTarget : mutexSourceDef . getMutexTargetList ( ) ) { final NamedArgumentDefinition mutexTargetDef = namedArgumentsDefinitionsByAlias . get ( mutexTarget ) ; if ( mutexTargetDef == null ) { throw new CommandLineExce...
public class RingbufferContainer { /** * Converts the { @ code item } into the ringbuffer { @ link InMemoryFormat } or * keeps it unchanged if the supplied argument is already in the ringbuffer * format . * @ param item the item * @ return the binary or deserialized format , depending on the { @ link Ringbuffer...
return inMemoryFormat == OBJECT ? ( E ) serializationService . toObject ( item ) : ( E ) serializationService . toData ( item ) ;
public class ThreadLocalRandom { /** * Returns an effectively unlimited stream of pseudorandom { @ code int } * values . * @ implNote This method is implemented to be equivalent to { @ code * ints ( Long . MAX _ VALUE ) } . * @ return a stream of pseudorandom { @ code int } values * @ since 1.8 */ public IntS...
return StreamSupport . intStream ( new RandomIntsSpliterator ( 0L , Long . MAX_VALUE , Integer . MAX_VALUE , 0 ) , false ) ;
public class DatastreamFilenameHelper { /** * Add a content disposition header to a MIMETypedStream based on configuration preferences . * Header by default specifies " inline " ; if download = true then " attachment " is specified . * @ param context * @ param pid * @ param dsID * @ param download * true i...
String headerValue = null ; String filename = null ; // is downloading requested ? if ( download != null && download . equals ( "true" ) ) { // generate an " attachment " content disposition header with the filename filename = getFilename ( context , pid , dsID , asOfDateTime , stream . getMIMEType ( ) ) ; headerValue ...
public class XmlParser { public synchronized Node parse ( InputSource source ) throws IOException , SAXException { } }
Handler handler = new Handler ( ) ; XMLReader reader = _parser . getXMLReader ( ) ; reader . setContentHandler ( handler ) ; reader . setErrorHandler ( handler ) ; reader . setEntityResolver ( handler ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "parsing: sid=" + source . getSystemId ( ) + ",pid=" + source . getPu...
public class CassandraClientBase { /** * On super column . * @ param m * the m * @ param isRelation * the is relation * @ param relations * the relations * @ param entities * the entities * @ param superColumns * the super columns * @ param key * the key */ protected void onSuperColumn ( EntityM...
Object e = null ; Object id = PropertyAccessorHelper . getObject ( m . getIdAttribute ( ) . getJavaType ( ) , key . array ( ) ) ; ThriftRow tr = new ThriftRow ( id , m . getTableName ( ) , new ArrayList < Column > ( 0 ) , superColumns , new ArrayList < CounterColumn > ( 0 ) , new ArrayList < CounterSuperColumn > ( 0 ) ...
public class CPlugin { /** * { @ inheritDoc } */ @ Override public void define ( Context context ) { } }
List < Object > l = new ArrayList < > ( ) ; // plugin elements l . add ( CLanguage . class ) ; l . add ( CDefaultProfile . class ) ; l . add ( CRuleRepository . class ) ; // reusable elements l . addAll ( getSensorsImpl ( ) ) ; // properties elements l . addAll ( generalProperties ( ) ) ; l . addAll ( codeAnalysisPrope...
public class ConfigUtil { /** * { @ link # parseMetaData } helper function . */ protected static String parseValue ( String line ) { } }
int eidx = line . indexOf ( "=" ) ; return ( eidx == - 1 ) ? "" : line . substring ( eidx + 1 ) . trim ( ) ;
public class AnalyticsHandler { /** * Parses the query rows from the content stream as long as there is data to be found . */ private void parseQueryRows ( boolean lastChunk ) { } }
while ( true ) { int openBracketPos = findNextChar ( responseContent , '{' ) ; if ( isEmptySection ( openBracketPos ) || ( lastChunk && openBracketPos < 0 ) ) { sectionDone ( ) ; queryParsingState = transitionToNextToken ( lastChunk ) ; break ; } int closeBracketPos = findSectionClosingPosition ( responseContent , '{' ...
public class DatatypeConverter { /** * Parse a duration value . * @ param value duration value * @ return Duration instance */ public static final Duration parseDuration ( String value ) { } }
return value == null ? null : Duration . getInstance ( Double . parseDouble ( value ) , TimeUnit . DAYS ) ;
public class Locations { /** * Creates a { @ link org . apache . twill . filesystem . Location } instance which represents the parent of the given location . * @ param location location to extra parent from . * @ return an instance representing the parent location or { @ code null } if there is no parent . */ @ Nul...
URI source = location . toURI ( ) ; // If it is root , return null if ( "/" . equals ( source . getPath ( ) ) ) { return null ; } URI resolvedParent = URI . create ( source . toString ( ) + "/.." ) . normalize ( ) ; return location . getLocationFactory ( ) . create ( resolvedParent ) ;
public class CmsProjectDriver { /** * Writes data for a publish job . < p > * @ param dbc the database context * @ param publishJobHistoryId the publish job id * @ param queryKey the query to use * @ param fieldName the fiueld to use * @ param data the data to write * @ throws CmsDataAccessException if some...
Connection conn = null ; PreparedStatement stmt = null ; PreparedStatement commit = null ; ResultSet res = null ; boolean wasInTransaction = false ; try { conn = m_sqlManager . getConnection ( dbc ) ; stmt = m_sqlManager . getPreparedStatement ( conn , queryKey ) ; wasInTransaction = ! conn . getAutoCommit ( ) ; if ( !...
public class RequiredValidator { /** * VALIDATE */ public void validate ( FacesContext facesContext , UIComponent uiComponent , Object value ) throws ValidatorException { } }
if ( facesContext == null ) { throw new NullPointerException ( "facesContext" ) ; } if ( uiComponent == null ) { throw new NullPointerException ( "uiComponent" ) ; } // Check if the value is empty like UIInput . validateValue boolean empty = value == null || ( value instanceof String && ( ( String ) value ) . length ( ...
public class DefaultTextBundleRegistry { /** * java properties bundle name * @ param bundleName * @ param locale * @ return convented properties ended file path . */ protected final String toJavaResourceName ( String bundleName , Locale locale ) { } }
String fullName = bundleName ; final String localeName = toLocaleStr ( locale ) ; final String suffix = "properties" ; if ( ! "" . equals ( localeName ) ) fullName = fullName + "_" + localeName ; StringBuilder sb = new StringBuilder ( fullName . length ( ) + 1 + suffix . length ( ) ) ; sb . append ( fullName . replace ...
public class TransientUserLayoutManagerWrapper { /** * Given an functional name , return its subscribe id . * @ param fname the functional name to lookup * @ return the fname ' s subscribe id . */ @ Override public String getSubscribeId ( String fname ) throws PortalException { } }
// see if a given subscribe id is already in the map String subId = mFnameMap . get ( fname ) ; if ( subId == null ) { // see if a given subscribe id is already in the layout subId = man . getSubscribeId ( fname ) ; } // obtain a description of the transient channel and // assign a new transient channel id if ( subId =...
public class JumblrClient { /** * Get the queued posts for a given blog * @ param blogName the name of the blog * @ param options the options for this call ( or null ) * @ return a List of posts */ public List < Post > blogQueuedPosts ( String blogName , Map < String , ? > options ) { } }
return requestBuilder . get ( JumblrClient . blogPath ( blogName , "/posts/queue" ) , options ) . getPosts ( ) ;
public class Solo { /** * Scroll a AbsListView matching the specified index to the specified line . * @ param index the index of the { @ link AbsListView } to scroll * @ param line the line to scroll to */ public void scrollListToLine ( int index , int line ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToLine(" + index + ", " + line + ")" ) ; } scroller . scrollListToLine ( waiter . waitForAndGetView ( index , AbsListView . class ) , line ) ;
public class SizeConstraintSetSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SizeConstraintSetSummary sizeConstraintSetSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( sizeConstraintSetSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sizeConstraintSetSummary . getSizeConstraintSetId ( ) , SIZECONSTRAINTSETID_BINDING ) ; protocolMarshaller . marshall ( sizeConstraintSetSummary . getName ( ) ,...
public class Routes { /** * Add a filter * @ param httpMethod the http - method of the route * @ param filter the filter to add */ public void add ( HttpMethod httpMethod , FilterImpl filter ) { } }
add ( httpMethod , filter . getPath ( ) , filter . getAcceptType ( ) , filter ) ;
public class JSLocalConsumerPoint { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . impl . interfaces . ConsumerPoint # closeSession ( ) */ @ Override public void closeSession ( Throwable e ) throws SIConnectionLostException , SIResourceException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "closeSession" , e ) ; if ( e == null ) { // try and build an appropriate exception if ( _consumerKey . isClosedDueToDelete ( ) ) { e = new SISessionDroppedException ( nls . getFormattedMessage ( "DESTINATION_DELETED_ERROR_C...
public class CglibDynamicBeanProxy { /** * Creates a proxy class of bean and returns an instance of that class . * @ param context the activity context * @ param beanRule the bean rule * @ param args the arguments passed to a constructor * @ param argTypes the parameter types for a constructor * @ return a ne...
Enhancer enhancer = new Enhancer ( ) ; enhancer . setClassLoader ( context . getEnvironment ( ) . getClassLoader ( ) ) ; enhancer . setSuperclass ( beanRule . getBeanClass ( ) ) ; enhancer . setCallback ( new CglibDynamicBeanProxy ( context , beanRule ) ) ; return enhancer . create ( argTypes , args ) ;
public class MAPProviderImpl { public void onTCBegin ( TCBeginIndication tcBeginIndication ) { } }
ApplicationContextName acn = tcBeginIndication . getApplicationContextName ( ) ; Component [ ] comps = tcBeginIndication . getComponents ( ) ; // ETS 300 974 Section 12.1.3 // On receipt of a TC - BEGIN indication primitive , the MAP PM shall : // - if no application - context - name is included in the primitive and if...
public class CIType { /** * Tests , if this type is kind of the type in the parameter ( question is , is * this type a child of the parameter type ) . * @ param _ type type to test for parent * @ return true if this type is a child , otherwise false */ public boolean isKindOf ( final org . efaps . admin . datamod...
return getType ( ) . isKindOf ( _type ) ;
public class InkView { @ Override protected void onSizeChanged ( int w , int h , int oldw , int oldh ) { } }
super . onSizeChanged ( w , h , oldw , oldh ) ; clear ( ) ;
public class ChunkFrequencyManager { /** * Initialize the map of chunks . */ private void initChunkMap ( ) { } }
Statement stmt = null ; Connection connection = null ; try { Class . forName ( "org.sqlite.JDBC" ) ; connection = DriverManager . getConnection ( "jdbc:sqlite:" + databasePath ) ; // retrieve chunk IDs from database String sql = "SELECT id, chromosome, start FROM chunk" ; stmt = connection . createStatement ( ) ; Resul...
public class PackratMemo { /** * This method puts memozation elements into the buffer . It is designed in a * way , that entries , once set , are not changed anymore . This is needed not to * break references ! * @ param production * @ param position * @ param stackElement */ void setMemo ( String production ...
Map < String , MemoEntry > map = memo . get ( position ) ; if ( map == null ) { map = new HashMap < String , MemoEntry > ( ) ; memo . put ( position , map ) ; map . put ( production , stackElement ) ; } else { if ( map . containsKey ( production ) ) { throw new RuntimeException ( "We should not set a memo twice. Modify...
public class FileUtil { /** * 创建文件及其父目录 , 如果这个文件存在 , 直接返回这个文件 < br > * 此方法不对File对象类型做判断 , 如果File不存在 , 无法判断其类型 * @ param file 文件对象 * @ return 文件 , 若路径为null , 返回null * @ throws IORuntimeException IO异常 */ public static File touch ( File file ) throws IORuntimeException { } }
if ( null == file ) { return null ; } if ( false == file . exists ( ) ) { mkParentDirs ( file ) ; try { file . createNewFile ( ) ; } catch ( Exception e ) { throw new IORuntimeException ( e ) ; } } return file ;