signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class WhitelistingApi { /** * Get whitelisted vdids of a device type . * Get whitelisted vdids of a device type . * @ param dtid Device Type ID . ( required ) * @ param count Max results count . ( optional ) * @ param offset Result starting offset . ( optional ) * @ return WhitelistResultEnvelope * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public WhitelistResultEnvelope getWhitelist ( String dtid , Integer count , Integer offset ) throws ApiException { } }
ApiResponse < WhitelistResultEnvelope > resp = getWhitelistWithHttpInfo ( dtid , count , offset ) ; return resp . getData ( ) ;
public class MapBuilder { /** * Adds the string value to the provided map under the provided field name , * if it should be included . */ public MapBuilder add ( String fieldName , boolean include , @ Nullable String value ) { } }
if ( include && value != null ) { map . put ( getFieldName ( fieldName ) , value ) ; } return this ;
public class ImageIOGreyScale { /** * Returns an < code > Iterator < / code > containing all currently registered < code > ImageReader < / code > s that * claim to be able to decode files with the given MIME type . * @ param MIMEType * a < code > String < / code > containing a file suffix ( < i > e . g . < / i > , " image / jpeg " or " image / x - bmp " ) . * @ return an < code > Iterator < / code > containing < code > ImageReader < / code > s . * @ exception IllegalArgumentException * if < code > MIMEType < / code > is < code > null < / code > . * @ see javax . imageio . spi . ImageReaderSpi # getMIMETypes */ public static Iterator < ImageReader > getImageReadersByMIMEType ( String MIMEType ) { } }
if ( MIMEType == null ) { throw new IllegalArgumentException ( "MIMEType == null!" ) ; } // Ensure category is present Iterator iter ; try { iter = theRegistry . getServiceProviders ( ImageReaderSpi . class , new ContainsFilter ( readerMIMETypesMethod , MIMEType ) , true ) ; } catch ( IllegalArgumentException e ) { return new HashSet ( ) . iterator ( ) ; } return new ImageReaderIterator ( iter ) ;
public class JmsConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . api . jms . JmsConnection # reportException ( javax . jms . JMSException ) */ @ Override public void reportException ( JMSException e ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reportException" , e ) ; if ( elRef . get ( ) != null ) { asyncExceptionTask . handleException ( e ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "No exception listener is currently set for this connection." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reportException" ) ;
public class Operators { /** * where */ private void setOperatorName ( Tag tag , String name ) { } }
setOperatorName ( tag , names . fromString ( name ) ) ;
public class Chain { /** * Set and connect to the peer to be used as the event source . * @ param peerUrl peerUrl * @ param pem permission */ public void eventHubConnect ( String peerUrl , String pem ) { } }
this . eventHub . setPeerAddr ( peerUrl , pem ) ; this . eventHub . connect ( ) ;
public class DrizzleResultSet { /** * Retrieves the value of the designated column in the current row of this < code > ResultSet < / code > object as a * < code > java . net . URL < / code > object in the Java programming language . * @ param columnLabel the label for the column specified with the SQL AS clause . If the SQL AS clause was not * specified , then the label is the name of the column * @ return the column value as a < code > java . net . URL < / code > object ; if the value is SQL < code > NULL < / code > , the value * returned is < code > null < / code > in the Java programming language * @ throws java . sql . SQLException if the columnLabel is not valid ; if a database access error occurs ; this method is * called on a closed result set or if a URL is malformed * @ throws java . sql . SQLFeatureNotSupportedException * if the JDBC driver does not support this method * @ since 1.4 */ public URL getURL ( final String columnLabel ) throws SQLException { } }
try { return new URL ( getValueObject ( columnLabel ) . getString ( ) ) ; } catch ( MalformedURLException e ) { throw SQLExceptionMapper . getSQLException ( "Could not parse as URL" ) ; }
public class SegmentFactory { /** * use getShape method to get object of type shape */ public Segment getSegment ( SEGMENT_TYPE segmentType ) { } }
if ( segmentType == null ) { return null ; } if ( segmentType == SEGMENT_TYPE . LINEAR ) { return new LinearSegment ( ) ; } else if ( segmentType == SEGMENT_TYPE . SPATIAL ) { return new SpatialSegment ( ) ; } else if ( segmentType == SEGMENT_TYPE . TEMPORAL ) { return new TemporalSegment ( ) ; } else if ( segmentType == SEGMENT_TYPE . SPATIOTEMPORAL ) { return new SpatioTemporalSegment ( ) ; } return null ;
public class FreemarkerEngine { /** * 创建配置项 * @ param config 模板配置 * @ return { @ link Configuration } */ private static Configuration createCfg ( TemplateConfig config ) { } }
if ( null == config ) { config = new TemplateConfig ( ) ; } final Configuration cfg = new Configuration ( Configuration . VERSION_2_3_28 ) ; cfg . setLocalizedLookup ( false ) ; cfg . setDefaultEncoding ( config . getCharset ( ) . toString ( ) ) ; switch ( config . getResourceMode ( ) ) { case CLASSPATH : cfg . setTemplateLoader ( new ClassTemplateLoader ( ClassUtil . getClassLoader ( ) , config . getPath ( ) ) ) ; break ; case FILE : try { cfg . setTemplateLoader ( new FileTemplateLoader ( FileUtil . file ( config . getPath ( ) ) ) ) ; } catch ( IOException e ) { throw new IORuntimeException ( e ) ; } break ; case WEB_ROOT : try { cfg . setTemplateLoader ( new FileTemplateLoader ( FileUtil . file ( FileUtil . getWebRoot ( ) , config . getPath ( ) ) ) ) ; } catch ( IOException e ) { throw new IORuntimeException ( e ) ; } break ; case STRING : cfg . setTemplateLoader ( new SimpleStringTemplateLoader ( ) ) ; break ; default : break ; } return cfg ;
public class InboundResourceadapterTypeImpl { /** * If not already created , a new < code > messageadapter < / code > element with the given value will be created . * Otherwise , the existing < code > messageadapter < / code > element will be returned . * @ return a new or existing instance of < code > MessageadapterType < InboundResourceadapterType < T > > < / code > */ public MessageadapterType < InboundResourceadapterType < T > > getOrCreateMessageadapter ( ) { } }
Node node = childNode . getOrCreate ( "messageadapter" ) ; MessageadapterType < InboundResourceadapterType < T > > messageadapter = new MessageadapterTypeImpl < InboundResourceadapterType < T > > ( this , "messageadapter" , childNode , node ) ; return messageadapter ;
public class HashUserRealm { /** * Add a user to a role . * @ param userName * @ param roleName */ public synchronized void addUserToRole ( String userName , String roleName ) { } }
HashSet userSet = ( HashSet ) _roles . get ( roleName ) ; if ( userSet == null ) { userSet = new HashSet ( 11 ) ; _roles . put ( roleName , userSet ) ; } userSet . add ( userName ) ;
public class APSPSolver { /** * Create many new variables ( batch ) - i . e . , many timepoints . */ @ Override protected Variable [ ] createVariablesSub ( int num ) { } }
int [ ] tp = tpCreate ( num ) ; Variable [ ] ret = new Variable [ num ] ; for ( int i = 0 ; i < tp . length ; i ++ ) { ret [ i ] = tPoints [ tp [ i ] ] ; } return ret ;
public class DateUtil { /** * 查询时间是否在今日 * @ param date 时间字符串 * @ param format 时间字符串的格式 * @ return 如果指定日期对象在今天则返回 < code > true < / code > */ public static boolean isToday ( String date , String format ) { } }
String now = getFormatDate ( SHORT ) ; String target = getFormatDate ( SHORT , parse ( date , format ) ) ; return now . equals ( target ) ;
public class WSubMenu { /** * Indicates whether this is a top - level menu ( ie . attached to a menu bar ) . * @ return { @ code true } if this is a top - level menu . */ public boolean isTopLevelMenu ( ) { } }
MenuContainer container = WebUtilities . getAncestorOfClass ( MenuContainer . class , this ) ; if ( container instanceof WMenuItemGroup ) { container = WebUtilities . getAncestorOfClass ( MenuContainer . class , container ) ; } return container instanceof WMenu ;
public class RollableScalableResourceOperation { /** * Let ' s wait until there are enough Ready pods . */ private void waitUntilScaled ( final int count ) { } }
final ArrayBlockingQueue < Object > queue = new ArrayBlockingQueue < > ( 1 ) ; final AtomicReference < Integer > replicasRef = new AtomicReference < > ( 0 ) ; final String name = checkName ( getItem ( ) ) ; final String namespace = checkNamespace ( getItem ( ) ) ; final Runnable tPoller = ( ) -> { try { T t = get ( ) ; // If the resource is gone , we shouldn ' t wait . if ( t == null ) { if ( count == 0 ) { queue . put ( true ) ; } else { queue . put ( new IllegalStateException ( "Can't wait for " + getType ( ) . getSimpleName ( ) + ": " + name + " in namespace: " + namespace + " to scale. Resource is no longer available." ) ) ; } return ; } int currentReplicas = getCurrentReplicas ( t ) ; int desiredReplicas = getDesiredReplicas ( t ) ; replicasRef . set ( currentReplicas ) ; long generation = t . getMetadata ( ) . getGeneration ( ) != null ? t . getMetadata ( ) . getGeneration ( ) : - 1 ; long observedGeneration = getObservedGeneration ( t ) ; if ( observedGeneration >= generation && Objects . equals ( desiredReplicas , currentReplicas ) ) { queue . put ( true ) ; } Log . debug ( "Only {}/{} replicas scheduled for {}: {} in namespace: {} seconds so waiting..." , currentReplicas , desiredReplicas , t . getKind ( ) , t . getMetadata ( ) . getName ( ) , namespace ) ; } catch ( Throwable t ) { Log . error ( "Error while waiting for resource to be scaled." , t ) ; } } ; ScheduledExecutorService executor = Executors . newSingleThreadScheduledExecutor ( ) ; ScheduledFuture poller = executor . scheduleWithFixedDelay ( tPoller , 0 , POLL_INTERVAL_MS , TimeUnit . MILLISECONDS ) ; try { if ( Utils . waitUntilReady ( queue , rollingTimeout , rollingTimeUnit ) ) { Log . debug ( "{}/{} pod(s) ready for {}: {} in namespace: {}." , replicasRef . get ( ) , count , getType ( ) . getSimpleName ( ) , name , namespace ) ; } else { Log . error ( "{}/{} pod(s) ready for {}: {} in namespace: {} after waiting for {} seconds so giving up" , replicasRef . get ( ) , count , getType ( ) . getSimpleName ( ) , name , namespace , rollingTimeUnit . toSeconds ( rollingTimeout ) ) ; } } finally { poller . cancel ( true ) ; executor . shutdown ( ) ; }
public class CollectionProxyDefaultImpl { /** * Determines the number of elements that the query would return . Override this * method if the size shall be determined in a specific way . * @ return The number of elements */ protected synchronized int loadSize ( ) throws PersistenceBrokerException { } }
PersistenceBroker broker = getBroker ( ) ; try { return broker . getCount ( getQuery ( ) ) ; } catch ( Exception ex ) { throw new PersistenceBrokerException ( ex ) ; } finally { releaseBroker ( broker ) ; }
public class Mappings { /** * Filter the mappings for those which cover a unique set of atoms in the * target . The unique atom mappings are a subset of the unique bond * matches . * @ return fluent - api instance * @ see # uniqueBonds ( ) */ public Mappings uniqueAtoms ( ) { } }
// we need the unique predicate to be reset for each new iterator - // otherwise multiple iterations are always filtered ( seen before ) return new Mappings ( query , target , new Iterable < int [ ] > ( ) { @ Override public Iterator < int [ ] > iterator ( ) { return Iterators . filter ( iterable . iterator ( ) , new UniqueAtomMatches ( ) ) ; } } ) ;
public class TagResourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TagResourceRequest tagResourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( tagResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tagResourceRequest . getResourceArn ( ) , RESOURCEARN_BINDING ) ; protocolMarshaller . marshall ( tagResourceRequest . getTagsToAdd ( ) , TAGSTOADD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Raytrace { /** * Gets the closest { @ link Point } of the origin . * @ param points the points * @ return the closest point */ private Pair < EnumFacing , Point > getClosest ( List < Pair < EnumFacing , Point > > points ) { } }
double distance = Double . MAX_VALUE ; Pair < EnumFacing , Point > ret = null ; for ( Pair < EnumFacing , Point > pair : points ) { double d = Point . distanceSquared ( src , pair . getRight ( ) ) ; if ( distance > d ) { distance = d ; ret = pair ; } } return ret ;
public class ObjectUtil { /** * Compare the type Writable . * @ param one the original object * @ param other the object to be compared . * @ return if 0 , are equal . */ public static int typeCompareTo ( Writable one , Writable other ) { } }
PrimitiveObject noOne = hadoop2Primitive ( one ) ; PrimitiveObject noOther = hadoop2Primitive ( other ) ; if ( noOne . getType ( ) != noOther . getType ( ) ) { return - 1 ; } return 0 ;
public class RottenTomatoesApi { /** * Pulls the complete movie cast for a movie * @ param movieId RT Movie ID * @ return * @ throws RottenTomatoesException */ public List < RTCast > getCastInfo ( int movieId ) throws RottenTomatoesException { } }
properties . clear ( ) ; properties . put ( ApiBuilder . PROPERTY_ID , String . valueOf ( movieId ) ) ; properties . put ( ApiBuilder . PROPERTY_URL , URL_CAST_INFO ) ; WrapperLists wrapper = response . getResponse ( WrapperLists . class , properties ) ; if ( wrapper != null && wrapper . getCast ( ) != null ) { return wrapper . getCast ( ) ; } else { return Collections . emptyList ( ) ; }
public class PartitionTable { /** * Sort the set of variables and join to a comma - delimited string . */ private static String buildKey ( Set < String > variables ) { } }
return variables . stream ( ) . sorted ( ) . collect ( Collectors . joining ( ", " ) ) ;
public class DBDataProvider { /** * { @ inheritDoc } * @ throws TechnicalException * is thrown if you have a technical error ( IOException on . sql file ) in NoraUi . */ @ Override public int getNbLines ( ) throws TechnicalException { } }
String sqlRequest = "" ; try { final Path file = Paths . get ( dataInPath + scenarioName + ".sql" ) ; sqlRequest = new String ( Files . readAllBytes ( file ) , Charset . forName ( Constants . DEFAULT_ENDODING ) ) ; sqlSanitized4readOnly ( sqlRequest ) ; } catch ( final IOException e ) { throw new TechnicalException ( Messages . getMessage ( TechnicalException . TECHNICAL_ERROR_MESSAGE ) + e . getMessage ( ) , e ) ; } try ( Connection connection = getConnection ( ) ; Statement statement = connection . createStatement ( ResultSet . TYPE_SCROLL_INSENSITIVE , ResultSet . CONCUR_READ_ONLY ) ; ResultSet rs = statement . executeQuery ( sqlRequest ) ; ) { return rs . last ( ) ? rs . getRow ( ) + 1 : 0 ; } catch ( final SQLException e ) { logger . error ( "error DBDataProvider.getNbLines()" , e ) ; return 0 ; }
public class AbstractCoalescingBufferQueue { /** * Copy all pending entries in this queue into the destination queue . * @ param dest to copy pending buffers to . */ public final void copyTo ( AbstractCoalescingBufferQueue dest ) { } }
dest . bufAndListenerPairs . addAll ( bufAndListenerPairs ) ; dest . incrementReadableBytes ( readableBytes ) ;
public class LBiObjSrtPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T1 , T2 > LBiObjSrtPredicate < T1 , T2 > biObjSrtPredicateFrom ( Consumer < LBiObjSrtPredicateBuilder < T1 , T2 > > buildingFunction ) { } }
LBiObjSrtPredicateBuilder builder = new LBiObjSrtPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class JsonSerializer { /** * Deserializes a Json string representation to an object . */ public Object deserialize ( String jsonObject ) { } }
if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Deserializing Json object" ) ; } XStream xstream = new XStream ( new JettisonMappedXmlDriver ( ) ) ; Object obj = xstream . fromXML ( jsonObject ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Object deserialized" ) ; } return obj ;
public class VersionListener { /** * Simple semantic version */ @ Override public void exitPostfix_version ( VersionParser . Postfix_versionContext ctx ) { } }
SemanticVersion version = null ; int count = ctx . getChildCount ( ) ; Object o = stack . pop ( ) ; if ( ! ( o instanceof String ) ) { throw new InvalidRangeRuntimeException ( "Expected string, got " + o . getClass ( ) . getSimpleName ( ) + " (" + o + ")" ) ; } String postfix = ( String ) o ; switch ( count ) { case 4 : { // 1.2.3alpha switch ( postfix . toUpperCase ( ) ) { case "RELEASE" : case "FINAL" : case "GA" : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) ) ; break ; default : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + "0" + "-" + postfix ) ; break ; } break ; } case 5 : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + "0" + "-" + postfix ) ; break ; case 6 : { // 1.2.3alpha switch ( postfix . toUpperCase ( ) ) { case "RELEASE" : case "FINAL" : case "GA" : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + ctx . getChild ( 4 ) . getText ( ) ) ; break ; default : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + ctx . getChild ( 4 ) . getText ( ) + "-" + postfix ) ; break ; } break ; } case 7 : { // 1.2.3 - alpha // 1.2.3 . alpha switch ( postfix . toUpperCase ( ) ) { case "RELEASE" : case "FINAL" : case "GA" : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + ctx . getChild ( 4 ) . getText ( ) ) ; break ; default : version = new SemanticVersion ( ctx . getChild ( 0 ) . getText ( ) + "." + ctx . getChild ( 2 ) . getText ( ) + "." + ctx . getChild ( 4 ) . getText ( ) + "-" + postfix ) ; break ; } break ; } case 8 : case 9 : { // 0.2.4.23-1 - deb7u1 int major = Integer . parseInt ( ctx . getChild ( 0 ) . getText ( ) ) ; int minor = Integer . parseInt ( ctx . getChild ( 2 ) . getText ( ) ) ; int patch = Integer . parseInt ( ctx . getChild ( 4 ) . getText ( ) ) ; int build = Integer . parseInt ( ctx . getChild ( 6 ) . getText ( ) ) ; version = new ExtendedSemanticVersion ( major , minor , patch , build , postfix ) ; break ; } } stack . push ( version ) ;
public class ReflectionUtils { /** * Returns the ( first ) instance of the annotation , on the class ( or any superclass , or interfaces implemented ) . * @ param c the class to examine * @ param annotation the annotation to find * @ param < T > the type of the annotation * @ return the list of annotations */ @ SuppressWarnings ( "unchecked" ) public static < T > List < T > getAnnotations ( final Class c , final Class < T > annotation ) { } }
final List < T > found = new ArrayList < T > ( ) ; // TODO isn ' t that actually breaking the contract of @ Inherited ? if ( c . isAnnotationPresent ( annotation ) ) { found . add ( ( T ) c . getAnnotation ( annotation ) ) ; } Class parent = c . getSuperclass ( ) ; while ( ( parent != null ) && ( parent != Object . class ) ) { if ( parent . isAnnotationPresent ( annotation ) ) { found . add ( ( T ) parent . getAnnotation ( annotation ) ) ; } // . . . and interfaces that the superclass implements for ( final Class interfaceClass : parent . getInterfaces ( ) ) { if ( interfaceClass . isAnnotationPresent ( annotation ) ) { found . add ( ( T ) interfaceClass . getAnnotation ( annotation ) ) ; } } parent = parent . getSuperclass ( ) ; } // . . . and all implemented interfaces for ( final Class interfaceClass : c . getInterfaces ( ) ) { if ( interfaceClass . isAnnotationPresent ( annotation ) ) { found . add ( ( T ) interfaceClass . getAnnotation ( annotation ) ) ; } } // no annotation found , use the defaults return found ;
public class PlanAssembler { /** * Get the unique set of names of all columns that are part of an index on * the given table . * @ param table * The table to build the list of index - affected columns with . * @ return The set of column names affected by indexes with duplicates * removed . */ private static Set < String > getIndexedColumnSetForTable ( Table table ) { } }
HashSet < String > columns = new HashSet < > ( ) ; for ( Index index : table . getIndexes ( ) ) { for ( ColumnRef colRef : index . getColumns ( ) ) { columns . add ( colRef . getColumn ( ) . getTypeName ( ) ) ; } } return columns ;
public class Logger { /** * Log a message with specific log level . * @ param logLevel the specific log level * @ param format the format of the message to log , null if just need to concat arguments * @ param args the arguments of the message to log * @ since 1.4.0 */ public void log ( int logLevel , String format , Object ... args ) { } }
println ( logLevel , format , args ) ;
public class FbBotMillBean { /** * Retrieves the recipient from an envelope . It never returns null . * @ param envelope * the message envelope . * @ return a { @ link User } containing the recipient if found , empty * otherwise . It never returns null . */ protected User safeGetRecipient ( MessageEnvelope envelope ) { } }
if ( envelope != null && envelope . getRecipient ( ) != null && envelope . getRecipient ( ) . getId ( ) != null ) { return envelope . getRecipient ( ) ; } return new User ( ) ;
public class DerParser { /** * Read next object . If it ' s constructed , the value holds * encoded content and it should be parsed by a new * parser from < code > Asn1Object . getParser < / code > . * @ return A object * @ throws IOException */ public Asn1Object read ( ) throws IOException { } }
int tag = in . read ( ) ; if ( tag == - 1 ) throw new IOException ( "Invalid DER: stream too short, missing tag" ) ; // $ NON - NLS - 1 $ int length = getLength ( ) ; byte [ ] value = new byte [ length ] ; int n = in . read ( value ) ; if ( n < length ) throw new IOException ( "Invalid DER: stream too short, missing value" ) ; // $ NON - NLS - 1 $ Asn1Object o = new Asn1Object ( tag , length , value ) ; return o ;
public class Maps { /** * Returns the value associated with the specified { @ code key } if it exists in the specified { @ code map } contains , or the new put { @ code Map } if it ' s absent . * @ param map * @ param key * @ return */ public static < K , KK , VV > Map < KK , VV > getAndPutMapIfAbsent ( final Map < K , Map < KK , VV > > map , final K key ) { } }
Map < KK , VV > v = map . get ( key ) ; if ( v == null ) { v = new HashMap < > ( ) ; v = map . put ( key , v ) ; } return v ;
public class JsonReader { /** * Reads the next array as a collection . * @ param < T > the collection type * @ param supplier the supplier to create a new collection * @ return the collection containing the items in the next array * @ throws IOException Something went wrong reading */ public < T extends Collection < Val > > T nextCollection ( @ NonNull Supplier < T > supplier ) throws IOException { } }
return nextCollection ( supplier , StringUtils . EMPTY ) ;
public class ExportConfigurationsInner { /** * Create a Continuous Export configuration of an Application Insights component . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; ApplicationInsightsComponentExportConfigurationInner & gt ; object */ public Observable < List < ApplicationInsightsComponentExportConfigurationInner > > createAsync ( String resourceGroupName , String resourceName , ApplicationInsightsComponentExportRequest exportProperties ) { } }
return createWithServiceResponseAsync ( resourceGroupName , resourceName , exportProperties ) . map ( new Func1 < ServiceResponse < List < ApplicationInsightsComponentExportConfigurationInner > > , List < ApplicationInsightsComponentExportConfigurationInner > > ( ) { @ Override public List < ApplicationInsightsComponentExportConfigurationInner > call ( ServiceResponse < List < ApplicationInsightsComponentExportConfigurationInner > > response ) { return response . body ( ) ; } } ) ;
public class BaseConnectionSource { /** * Return true if the connection being released is the one that has been saved . */ protected boolean isSavedConnection ( DatabaseConnection connection ) { } }
NestedConnection currentSaved = specialConnection . get ( ) ; if ( currentSaved == null ) { return false ; } else if ( currentSaved . connection == connection ) { // ignore the release when we have a saved connection return true ; } else { return false ; }
public class Interval { /** * Returns a new interval based on this interval but with a different start * and end time . * @ param startTime the new start time * @ param endTime the new end time * @ return a new interval */ public Interval withTimes ( LocalTime startTime , LocalTime endTime ) { } }
requireNonNull ( startTime ) ; requireNonNull ( endTime ) ; return new Interval ( this . startDate , startTime , this . endDate , endTime , this . zoneId ) ;
public class WCOutputStream31 { /** * @ see javax . servlet . ServletOutputStream # print ( double ) */ public void print ( double d ) throws IOException { } }
if ( this . _listener != null && ! checkIfCalledFromWLonError ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "non blocking print double , WriteListener enabled: " + this . _listener ) ; this . print_NonBlocking ( Double . toString ( d ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "print double" ) ; super . print ( d ) ; }
public class MBTilesDb { /** * Get the bounds of a zoomlevel in tile indexes . * < p > This comes handy when one wants to navigate all tiles of a zoomlevel . * @ param zoomlevel the zoom level . * @ return the tile indexes as [ minTx , maxTx , minTy , maxTy ] . * @ throws Exception */ public int [ ] getBoundsInTileIndex ( int zoomlevel ) throws Exception { } }
String sql = "select min(tile_column), max(tile_column), min(tile_row), max(tile_row) from tiles where zoom_level=" + zoomlevel ; return database . execOnConnection ( connection -> { try ( IHMStatement statement = connection . createStatement ( ) ; IHMResultSet resultSet = statement . executeQuery ( sql ) ; ) { if ( resultSet . next ( ) ) { int minTx = resultSet . getInt ( 1 ) ; int maxTx = resultSet . getInt ( 2 ) ; int minTy = resultSet . getInt ( 3 ) ; int maxTy = resultSet . getInt ( 4 ) ; return new int [ ] { minTx , maxTx , minTy , maxTy } ; } } return null ; } ) ;
public class BeetlUtil { /** * 渲染模板 , 如果为相对路径 , 则渲染ClassPath模板 , 否则渲染本地文件模板 * @ param path 路径 * @ param templateFileName 模板文件名 * @ param bindingMap 绑定参数 * @ return 渲染后的内容 * @ since 3.2.0 */ public static String render ( String path , String templateFileName , Map < String , Object > bindingMap ) { } }
if ( FileUtil . isAbsolutePath ( path ) ) { return render ( getFileTemplate ( path , templateFileName ) , bindingMap ) ; } else { return render ( getClassPathTemplate ( path , templateFileName ) , bindingMap ) ; }
public class CnvBnRsToLong { /** * < p > Convert parameter with using name . < / p > * @ param pAddParam additional params , e . g . entity class UserRoleTomcat * to reveal derived columns for its composite ID , or field Enum class * to reveal Enum value by index . * @ param pFrom from a bean * @ param pName by a name * @ return pTo to a bean * @ throws Exception - an exception */ @ Override public final Long convert ( final Map < String , Object > pAddParam , final IRecordSet < RS > pFrom , final String pName ) throws Exception { } }
return pFrom . getLong ( pName ) ;
public class BaseFilterQueryBuilder { /** * Add a Field Search Condition that will check if the id field exists in an array of values . eg . { @ code field IN ( values ) } * @ param property The field id as defined in the Entity mapping class . * @ param values The List of Ids to be compared to . */ protected void addIdNotInCollectionCondition ( final Expression < ? > property , final Collection < ? > values ) { } }
if ( values != null && ! values . isEmpty ( ) ) { fieldConditions . add ( getCriteriaBuilder ( ) . not ( property . in ( values ) ) ) ; }
public class Cli { /** * Utility method to start the CommonsCli using a main class and command line arguments * @ param mainClass * @ param args */ public static void start ( Class < ? > mainClass , final String [ ] args ) { } }
try { LifecycleInjector . bootstrap ( mainClass , new AbstractModule ( ) { @ Override protected void configure ( ) { bind ( String [ ] . class ) . annotatedWith ( Main . class ) . toInstance ( args ) ; } } ) ; } catch ( Exception e ) { throw new ProvisionException ( "Error instantiating main class" , e ) ; }
public class KernelCapabilities { /** * The Linux capabilities for the container that have been removed from the default configuration provided by * Docker . This parameter maps to < code > CapDrop < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the * < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the < code > - - cap - drop < / code > option * to < a href = " https : / / docs . docker . com / engine / reference / run / " > docker run < / a > . * Valid values : * < code > " ALL " | " AUDIT _ CONTROL " | " AUDIT _ WRITE " | " BLOCK _ SUSPEND " | " CHOWN " | " DAC _ OVERRIDE " | " DAC _ READ _ SEARCH " | " FOWNER " | " FSETID " | " IPC _ LOCK " | " IPC _ OWNER " | " KILL " | " LEASE " | " LINUX _ IMMUTABLE " | " MAC _ ADMIN " | " MAC _ OVERRIDE " | " MKNOD " | " NET _ ADMIN " | " NET _ BIND _ SERVICE " | " NET _ BROADCAST " | " NET _ RAW " | " SETFCAP " | " SETGID " | " SETPCAP " | " SETUID " | " SYS _ ADMIN " | " SYS _ BOOT " | " SYS _ CHROOT " | " SYS _ MODULE " | " SYS _ NICE " | " SYS _ PACCT " | " SYS _ PTRACE " | " SYS _ RAWIO " | " SYS _ RESOURCE " | " SYS _ TIME " | " SYS _ TTY _ CONFIG " | " SYSLOG " | " WAKE _ ALARM " < / code > * @ param drop * The Linux capabilities for the container that have been removed from the default configuration provided by * Docker . This parameter maps to < code > CapDrop < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section * of the < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the * < code > - - cap - drop < / code > option to < a href = " https : / / docs . docker . com / engine / reference / run / " > docker * run < / a > . < / p > * Valid values : * < code > " ALL " | " AUDIT _ CONTROL " | " AUDIT _ WRITE " | " BLOCK _ SUSPEND " | " CHOWN " | " DAC _ OVERRIDE " | " DAC _ READ _ SEARCH " | " FOWNER " | " FSETID " | " IPC _ LOCK " | " IPC _ OWNER " | " KILL " | " LEASE " | " LINUX _ IMMUTABLE " | " MAC _ ADMIN " | " MAC _ OVERRIDE " | " MKNOD " | " NET _ ADMIN " | " NET _ BIND _ SERVICE " | " NET _ BROADCAST " | " NET _ RAW " | " SETFCAP " | " SETGID " | " SETPCAP " | " SETUID " | " SYS _ ADMIN " | " SYS _ BOOT " | " SYS _ CHROOT " | " SYS _ MODULE " | " SYS _ NICE " | " SYS _ PACCT " | " SYS _ PTRACE " | " SYS _ RAWIO " | " SYS _ RESOURCE " | " SYS _ TIME " | " SYS _ TTY _ CONFIG " | " SYSLOG " | " WAKE _ ALARM " < / code > */ public void setDrop ( java . util . Collection < String > drop ) { } }
if ( drop == null ) { this . drop = null ; return ; } this . drop = new com . amazonaws . internal . SdkInternalList < String > ( drop ) ;
public class SarlDocumentationParser { /** * Read the given file and transform its content in order to have a raw text . * @ param inputFile the input file . * @ return the raw file context . */ public String transform ( File inputFile ) { } }
final String content ; try ( FileReader reader = new FileReader ( inputFile ) ) { content = read ( reader ) ; } catch ( IOException exception ) { reportError ( Messages . SarlDocumentationParser_0 , exception ) ; return null ; } return transform ( content , inputFile ) ;
public class ListSubscriptionsByTopicResult { /** * A list of subscriptions . * @ param subscriptions * A list of subscriptions . */ public void setSubscriptions ( java . util . Collection < Subscription > subscriptions ) { } }
if ( subscriptions == null ) { this . subscriptions = null ; return ; } this . subscriptions = new com . amazonaws . internal . SdkInternalList < Subscription > ( subscriptions ) ;
public class I18nProvider { /** * Converts a parameter using the application - specific constants . Only converts parameters of the form " $ { . . . . } " . * @ param parameter * parameter to look up ( must be of the form " $ { . . . . } " ) * @ return the converted parameter ( if conformal ) or the parameter itself */ public static String lookupParameter ( String parameter ) { } }
if ( parameter . startsWith ( "i18n:" ) ) { String methodName = parameter . substring ( 5 ) . replace ( '.' , '_' ) ; return lookup . getString ( methodName ) ; } else { return parameter ; }
public class SunburstChart { /** * Defines if the text color of the chart data should be adjusted according to the chart data fill color * @ param AUTOMATIC */ public void setAutoTextColor ( final boolean AUTOMATIC ) { } }
if ( null == autoTextColor ) { _autoTextColor = AUTOMATIC ; adjustTextColors ( ) ; redraw ( ) ; } else { autoTextColor . set ( AUTOMATIC ) ; }
public class CPDefinitionInventoryLocalServiceWrapper { /** * Returns a range of cp definition inventories matching the UUID and company . * @ param uuid the UUID of the cp definition inventories * @ param companyId the primary key of the company * @ param start the lower bound of the range of cp definition inventories * @ param end the upper bound of the range of cp definition inventories ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the range of matching cp definition inventories , or an empty list if no matches were found */ @ Override public java . util . List < com . liferay . commerce . model . CPDefinitionInventory > getCPDefinitionInventoriesByUuidAndCompanyId ( String uuid , long companyId , int start , int end , com . liferay . portal . kernel . util . OrderByComparator < com . liferay . commerce . model . CPDefinitionInventory > orderByComparator ) { } }
return _cpDefinitionInventoryLocalService . getCPDefinitionInventoriesByUuidAndCompanyId ( uuid , companyId , start , end , orderByComparator ) ;
public class StringMan { /** * Takes a string encoded in hex ( 00 - FF ) , two chars per byte , and returns an array of bytes . * array . length will be hex . length / 2 after hex has been run through { @ link # decompressHexString } */ public static byte [ ] decodeStringToBytes ( String hex ) { } }
hex = decompressHexString ( hex ) ; int stringLength = hex . length ( ) ; byte [ ] b = new byte [ stringLength / 2 ] ; for ( int i = 0 , j = 0 ; i < stringLength ; i += 2 , j ++ ) { int high = charToNibble ( hex . charAt ( i ) ) ; int low = charToNibble ( hex . charAt ( i + 1 ) ) ; b [ j ] = ( byte ) ( ( high << 4 ) | low ) ; } return b ;
public class ListTargetsByRuleResult { /** * The targets assigned to the rule . * @ param targets * The targets assigned to the rule . */ public void setTargets ( java . util . Collection < Target > targets ) { } }
if ( targets == null ) { this . targets = null ; return ; } this . targets = new java . util . ArrayList < Target > ( targets ) ;
public class DescribeChangeSetResult { /** * A list of < code > Parameter < / code > structures that describes the input parameters and their values used to create * the change set . For more information , see the < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / APIReference / API _ Parameter . html " > Parameter < / a > data * type . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setParameters ( java . util . Collection ) } or { @ link # withParameters ( java . util . Collection ) } if you want to * override the existing values . * @ param parameters * A list of < code > Parameter < / code > structures that describes the input parameters and their values used to * create the change set . For more information , see the < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / APIReference / API _ Parameter . html " > Parameter < / a > * data type . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeChangeSetResult withParameters ( Parameter ... parameters ) { } }
if ( this . parameters == null ) { setParameters ( new com . amazonaws . internal . SdkInternalList < Parameter > ( parameters . length ) ) ; } for ( Parameter ele : parameters ) { this . parameters . add ( ele ) ; } return this ;
public class SubsystemChannel { /** * Send a byte array as a message . * @ param msg * @ throws SshException * @ deprecated This has changed internally to use a * { @ link com . sshtools . ssh . Packet } and it is recommended that * all implementations change to use * { @ link com . sshtools . ssh . Packet } ' s as they provide a more * efficent way of sending data . */ protected void sendMessage ( byte [ ] msg ) throws SshException { } }
try { Packet pkt = createPacket ( ) ; pkt . write ( msg ) ; sendMessage ( pkt ) ; } catch ( IOException ex ) { throw new SshException ( SshException . UNEXPECTED_TERMINATION , ex ) ; }
public class Vertex { /** * Translates this { @ link Vertex } by the specified amount . * @ param x the x * @ param y the y * @ param z the z * @ return the vertex */ public Vertex translate ( double x , double y , double z ) { } }
this . x += x ; this . y += y ; this . z += z ; return this ;
public class EclipseAjcMojo { /** * TODO remove javac builder if aspectJ builder is used */ private boolean mergeBuilders ( Document document ) throws MojoExecutionException { } }
NodeList buildCommandList = document . getElementsByTagName ( "buildCommand" ) ; for ( int i = 0 ; i < buildCommandList . getLength ( ) ; i ++ ) { Element buildCommand = ( Element ) buildCommandList . item ( i ) ; NodeList nameList = buildCommand . getElementsByTagName ( "name" ) ; for ( int j = 0 ; j < nameList . getLength ( ) ; j ++ ) { Element name = ( Element ) nameList . item ( j ) ; if ( name . getNodeValue ( ) . equals ( AJ_BUILDER ) ) { return false ; } // if maven2 builder is used we don ' t need // use aspectJ builder if ( name . getNodeValue ( ) . equals ( M2_BUILDER ) ) { return false ; } } } // we need add aspectJ builder node NodeList buildSpecList = document . getElementsByTagName ( "buildSpec" ) ; if ( 0 == buildSpecList . getLength ( ) ) { NodeList nodes = document . getElementsByTagName ( "natures" ) ; if ( 0 == nodes . getLength ( ) ) { throw new MojoExecutionException ( "At least one nature must be specified in .project file!" ) ; } Element buildSpec = document . createElement ( "buildSpec" ) ; document . insertBefore ( buildSpec , nodes . item ( 0 ) ) ; buildSpecList = document . getElementsByTagName ( "buildSpec" ) ; } Element buildSpec = ( Element ) buildSpecList . item ( 0 ) ; Element buildCommand = document . createElement ( "buildCommand" ) ; // create & append < name / > Element name = document . createElement ( "name" ) ; name . setNodeValue ( AJ_BUILDER ) ; buildCommand . appendChild ( name ) ; // create & append < arguments / > buildCommand . appendChild ( document . createElement ( "arguments" ) ) ; buildSpec . insertBefore ( buildCommand , buildSpec . getFirstChild ( ) ) ; return true ;
public class RemoveUnusedCode { /** * Traverses a node recursively . Call this once per pass . */ private void traverseAndRemoveUnusedReferences ( Node root ) { } }
// Create scope from parent of root node , which also has externs as a child , so we ' ll // have extern definitions in scope . Scope scope = scopeCreator . createScope ( root . getParent ( ) , null ) ; if ( ! scope . hasSlot ( NodeUtil . JSC_PROPERTY_NAME_FN ) ) { // TODO ( b / 70730762 ) : Passes that add references to this should ensure it is declared . // NOTE : null input makes this an extern var . scope . declare ( NodeUtil . JSC_PROPERTY_NAME_FN , /* no declaration node */ null , /* no input */ null ) ; } worklist . add ( new Continuation ( root , scope ) ) ; while ( ! worklist . isEmpty ( ) ) { Continuation continuation = worklist . remove ( ) ; continuation . apply ( ) ; } removeUnreferencedVarsAndPolyfills ( ) ; removeIndependentlyRemovableProperties ( ) ; for ( Scope fparamScope : allFunctionParamScopes ) { removeUnreferencedFunctionArgs ( fparamScope ) ; }
public class MpscArrayQueue { /** * { @ link # offer } } if { @ link # size ( ) } is less than threshold . * @ param e the object to offer onto the queue , not null * @ param threshold the maximum allowable size * @ return true if the offer is successful , false if queue size exceeds threshold * @ since 1.0.1 */ public boolean offerIfBelowThreshold ( final E e , int threshold ) { } }
if ( null == e ) { throw new NullPointerException ( ) ; } final long mask = this . mask ; final long capacity = mask + 1 ; long producerLimit = lvProducerLimit ( ) ; // LoadLoad long pIndex ; do { pIndex = lvProducerIndex ( ) ; // LoadLoad long available = producerLimit - pIndex ; long size = capacity - available ; if ( size >= threshold ) { final long cIndex = lvConsumerIndex ( ) ; // LoadLoad size = pIndex - cIndex ; if ( size >= threshold ) { return false ; // the size exceeds threshold } else { // update producer limit to the next index that we must recheck the consumer index producerLimit = cIndex + capacity ; // this is racy , but the race is benign soProducerLimit ( producerLimit ) ; } } } while ( ! casProducerIndex ( pIndex , pIndex + 1 ) ) ; /* * NOTE : the new producer index value is made visible BEFORE the element in the array . If we relied on * the index visibility to poll ( ) we would need to handle the case where the element is not visible . */ // Won CAS , move on to storing final long offset = calcElementOffset ( pIndex , mask ) ; soElement ( buffer , offset , e ) ; // StoreStore return true ; // AWESOME : )
public class CourierTemplateSpecGenerator { /** * Determine name and class for unnamed types . */ private ClassInfo classInfoForUnnamed ( ClassTemplateSpec enclosingClass , String name , DataSchema schema ) { } }
assert ! ( schema instanceof NamedDataSchema ) ; assert ! ( schema instanceof PrimitiveDataSchema ) ; final ClassInfo classInfo = classNameForUnnamedTraverse ( enclosingClass , name , schema ) ; final String className = classInfo . fullName ( ) ; final DataSchema schemaFromClassName = _classNameToSchemaMap . get ( className ) ; if ( schemaFromClassName == null ) { final ClassTemplateSpec classTemplateSpec = createFromDataSchema ( schema ) ; if ( enclosingClass != null && classInfo . namespace . equals ( enclosingClass . getFullName ( ) ) ) { classTemplateSpec . setEnclosingClass ( enclosingClass ) ; classTemplateSpec . setClassName ( classInfo . name ) ; classTemplateSpec . setModifiers ( ModifierSpec . PUBLIC , ModifierSpec . STATIC , ModifierSpec . FINAL ) ; } else { classTemplateSpec . setNamespace ( classInfo . namespace ) ; classTemplateSpec . setClassName ( classInfo . name ) ; classTemplateSpec . setModifiers ( ModifierSpec . PUBLIC ) ; } classInfo . definedClass = classTemplateSpec ; } else { checkForClassNameConflict ( className , schema ) ; classInfo . existingClass = _schemaToClassMap . get ( schemaFromClassName ) ; } return classInfo ;
public class CmsMessageBundleEditorModel { /** * Locks the bundle descriptor . * @ throws CmsException thrown if locking fails . */ private void lockDescriptor ( ) throws CmsException { } }
if ( ( null == m_descFile ) && ( null != m_desc ) ) { m_descFile = LockedFile . lockResource ( m_cms , m_desc ) ; }
public class AbstractGenericsContext { /** * Shortcut for { @ link # resolveGenericsOf ( Type ) } useful for single generic types or * when just first generic required . * Check if type containing generics , belonging to different context in current hierarchy and * automatically change context to properly resolve generics . Fails when it is impossible to correctly * resolve generics ( preventing incorrect usage ) . * @ param type type to resolve generic * @ return first resolved generic or null if type does not use generics */ public Class < ? > resolveGenericOf ( final Type type ) { } }
final List < Class < ? > > res = resolveGenericsOf ( type ) ; return res . isEmpty ( ) ? null : res . get ( 0 ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SimpleTextureType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link SimpleTextureType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/texturedsurface/2.0" , name = "SimpleTexture" , substitutionHeadNamespace = "http://www.opengis.net/citygml/texturedsurface/2.0" , substitutionHeadName = "_Appearance" ) public JAXBElement < SimpleTextureType > createSimpleTexture ( SimpleTextureType value ) { } }
return new JAXBElement < SimpleTextureType > ( _SimpleTexture_QNAME , SimpleTextureType . class , null , value ) ;
public class GSECOLImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GSECOL__COLOR : setCOLOR ( COLOR_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class ClassBundleFactory { /** * Get the classes for all the fields * @ param clz The class * @ return The classes ; empty array if none */ private static Class < ? > [ ] getFields ( Class < ? > clz ) { } }
List < Class < ? > > result = new ArrayList < Class < ? > > ( ) ; Class < ? > c = clz ; while ( ! c . equals ( Object . class ) ) { try { Field [ ] fields = SecurityActions . getDeclaredFields ( c ) ; if ( fields . length > 0 ) { for ( Field f : fields ) { Class < ? > defClz = f . getType ( ) ; String defClzName = defClz . getName ( ) ; if ( ! defClz . isPrimitive ( ) && ! defClz . isArray ( ) && ! defClzName . startsWith ( "java" ) && ! defClzName . startsWith ( "javax" ) && ! result . contains ( defClz ) ) { if ( trace ) log . tracef ( "Adding field: %s" , defClzName ) ; result . add ( defClz ) ; } } } } catch ( Throwable t ) { // Ignore } c = c . getSuperclass ( ) ; } return result . toArray ( new Class < ? > [ result . size ( ) ] ) ;
public class InternalSimpleAntlrParser { /** * InternalSimpleAntlr . g : 736:1 : entryRuleOtherElement returns [ EObject current = null ] : iv _ ruleOtherElement = ruleOtherElement EOF ; */ public final EObject entryRuleOtherElement ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleOtherElement = null ; try { // InternalSimpleAntlr . g : 737:2 : ( iv _ ruleOtherElement = ruleOtherElement EOF ) // InternalSimpleAntlr . g : 738:2 : iv _ ruleOtherElement = ruleOtherElement EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getOtherElementRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_ruleOtherElement = ruleOtherElement ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = iv_ruleOtherElement ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return current ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class VarBindingDef { /** * Returns the effective condition that defines when this binding is applicable . */ public ICondition getEffectiveCondition ( ) { } }
if ( effCondition_ == null ) { effCondition_ = getValueDef ( ) . getEffectiveCondition ( getVarDef ( ) . getEffectiveCondition ( ) ) ; } return effCondition_ ;
public class Scanners { /** * A scanner that succeeds and consumes the current character if it satisfies the given * { @ link CharPredicate } . * @ param predicate the predicate . * @ param name the name of what ' s expected logically . Is used in error message . * @ return the scanner . * @ deprecated Implement { @ link Object # toString } in the { @ code CharPredicate } , * or use { @ code Patterns . isChar ( predicate ) . toScanner ( name ) } . */ @ Deprecated public static Parser < Void > isChar ( CharPredicate predicate , String name ) { } }
return Patterns . isChar ( predicate ) . toScanner ( name ) ;
public class CmsNewResourceTypeDialog { /** * Creates the parents of nested XML elements if necessary . * @ param xmlContent the XML content that is edited . * @ param xmlPath the path of the ( nested ) element , for which the parents should be created * @ param l the locale for which the XML content is edited . */ protected void createParentXmlElements ( CmsXmlContent xmlContent , String xmlPath , Locale l ) { } }
if ( CmsXmlUtils . isDeepXpath ( xmlPath ) ) { String parentPath = CmsXmlUtils . removeLastXpathElement ( xmlPath ) ; if ( null == xmlContent . getValue ( parentPath , l ) ) { createParentXmlElements ( xmlContent , parentPath , l ) ; xmlContent . addValue ( m_cms , parentPath , l , CmsXmlUtils . getXpathIndexInt ( parentPath ) - 1 ) ; } }
public class TableIndexDao { /** * Delete a TableIndex by id , cascading * @ param id * id * @ return rows deleted * @ throws SQLException * upon deletion failure */ public int deleteByIdCascade ( String id ) throws SQLException { } }
int count = 0 ; if ( id != null ) { TableIndex tableIndex = queryForId ( id ) ; if ( tableIndex != null ) { count = deleteCascade ( tableIndex ) ; } } return count ;
public class CmsLogFilter { /** * Returns an extended filter with the given type restriction . < p > * @ param type the relation type to include * @ return an extended filter with the given type restriction */ public CmsLogFilter includeType ( CmsLogEntryType type ) { } }
CmsLogFilter filter = ( CmsLogFilter ) clone ( ) ; filter . m_includeTypes . add ( type ) ; return filter ;
public class AbstractRasMethodAdapter { /** * Generate the instruction sequence needed to " box " a sensitive local variable * as a < code > null < / code > reference or the string * & quot ; & lt ; sensitive < i > type < / i > & gt ; & quot ; * @ param type * the < code > Type < / code > of the object in the specified local * variable slot on the stack . */ protected void boxSensitive ( final Type type ) { } }
if ( type . getSize ( ) == 2 ) { visitInsn ( POP2 ) ; } else { visitInsn ( POP ) ; } visitLdcInsn ( "<sensitive " + type . getClassName ( ) + ">" ) ;
public class Replicator { /** * Removes a document from the replicator database . * @ return { @ link Response } */ public com . cloudant . client . api . model . Response remove ( ) { } }
Response couchDbResponse = replicator . remove ( ) ; com . cloudant . client . api . model . Response response = new com . cloudant . client . api . model . Response ( couchDbResponse ) ; return response ;
public class WasInformedBy { /** * Gets the value of the informed property . * @ return * possible object is * { @ link org . openprovenance . prov . sql . IDRef } */ @ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { } }
CascadeType . ALL } ) @ JoinColumn ( name = "INFORMED" ) public org . openprovenance . prov . model . QualifiedName getInformed ( ) { return informed ;
public class Replacer { /** * Replaces the next occurrence of a matcher ' s pattern in a matcher ' s target by a given substitution , appending the * result to a buffer but not writing the remainder of m ' s match to the end of dest . * < br > * The substitution starts from current matcher ' s position , current match not included . * < br > * You typically want to call { @ code m . getGroup ( MatchResult . TARGET , dest ) ; } after you have called replaceStep ( ) * until it returns false , which will fill in the remainder of the matching text into dest . * @ param m a Matcher * @ param substitution a Substitution , typically a PerlSubstitution * @ param dest the TextBuffer this will write to ; see Replacer . wrap ( ) * @ return the number of replacements performed */ public static boolean replaceStep ( Matcher m , Substitution substitution , TextBuffer dest ) { } }
boolean firstPass = true ; int c = 0 , count = 1 ; while ( c < count && m . find ( ) ) { if ( m . end ( ) == 0 && ! firstPass ) continue ; // allow to replace at " ^ " if ( m . start ( ) > 0 ) m . getGroup ( MatchResult . PREFIX , dest ) ; substitution . appendSubstitution ( m , dest ) ; c ++ ; m . setTarget ( m , MatchResult . SUFFIX ) ; firstPass = false ; } return c > 0 ;
public class DateTimeFormatterBuilder { /** * Instructs the printer to emit a field value as a decimal number , and the * parser to expect an unsigned decimal number . * @ param fieldType type of field to append * @ param minDigits minimum number of digits to < i > print < / i > * @ param maxDigits maximum number of digits to < i > parse < / i > , or the estimated * maximum number of digits to print * @ return this DateTimeFormatterBuilder , for chaining * @ throws IllegalArgumentException if field type is null */ public DateTimeFormatterBuilder appendDecimal ( DateTimeFieldType fieldType , int minDigits , int maxDigits ) { } }
if ( fieldType == null ) { throw new IllegalArgumentException ( "Field type must not be null" ) ; } if ( maxDigits < minDigits ) { maxDigits = minDigits ; } if ( minDigits < 0 || maxDigits <= 0 ) { throw new IllegalArgumentException ( ) ; } if ( minDigits <= 1 ) { return append0 ( new UnpaddedNumber ( fieldType , maxDigits , false ) ) ; } else { return append0 ( new PaddedNumber ( fieldType , maxDigits , false , minDigits ) ) ; }
public class PdfCopy { /** * Grabs a page from the input document * @ param reader the reader of the document * @ param pageNumber which page to get * @ return the page */ public PdfImportedPage getImportedPage ( PdfReader reader , int pageNumber ) { } }
if ( currentPdfReaderInstance != null ) { if ( currentPdfReaderInstance . getReader ( ) != reader ) { try { currentPdfReaderInstance . getReader ( ) . close ( ) ; currentPdfReaderInstance . getReaderFile ( ) . close ( ) ; } catch ( IOException ioe ) { // empty on purpose } currentPdfReaderInstance = reader . getPdfReaderInstance ( this ) ; } } else { currentPdfReaderInstance = reader . getPdfReaderInstance ( this ) ; } return currentPdfReaderInstance . getImportedPage ( pageNumber ) ;
public class CoreUtils { /** * Return the local hostname , if it ' s resolvable . If not , * return the IPv4 address on the first interface we find , if it exists . * If not , returns whatever address exists on the first interface . * @ return the String representation of some valid host or IP address , * if we can find one ; the empty string otherwise */ public static String getHostnameOrAddress ( ) { } }
final InetAddress addr = m_localAddressSupplier . get ( ) ; if ( addr == null ) return "" ; return ReverseDNSCache . hostnameOrAddress ( addr ) ;
public class ArtifactFactoryConfig { /** * Returns the factory instance . If it does not exist , it will be created . Requires that { @ link # init ( SrcGen4JContext , Map ) } was called * once before . * @ return Factory . */ @ NotNull public final ArtifactFactory < ? > getFactory ( ) { } }
if ( factory == null ) { if ( factoryClassName == null ) { throw new IllegalStateException ( "Factory class name was not set: " + artifact ) ; } if ( context == null ) { throw new IllegalStateException ( "Context class loader was not set: " + artifact ) ; } final Object obj = Utils4J . createInstance ( factoryClassName , context . getClassLoader ( ) ) ; if ( ! ArtifactFactory . class . isAssignableFrom ( obj . getClass ( ) ) ) { throw new IllegalStateException ( "Expected an object of type '" + ArtifactFactory . class . getName ( ) + "', but was: " + obj . getClass ( ) ) ; } factory = ( ArtifactFactory < ? > ) obj ; factory . init ( this ) ; } return factory ;
public class TimeParametersImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setWaitTime ( Parameter newWaitTime ) { } }
if ( newWaitTime != waitTime ) { NotificationChain msgs = null ; if ( waitTime != null ) msgs = ( ( InternalEObject ) waitTime ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - BpsimPackage . TIME_PARAMETERS__WAIT_TIME , null , msgs ) ; if ( newWaitTime != null ) msgs = ( ( InternalEObject ) newWaitTime ) . eInverseAdd ( this , EOPPOSITE_FEATURE_BASE - BpsimPackage . TIME_PARAMETERS__WAIT_TIME , null , msgs ) ; msgs = basicSetWaitTime ( newWaitTime , msgs ) ; if ( msgs != null ) msgs . dispatch ( ) ; } else if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . TIME_PARAMETERS__WAIT_TIME , newWaitTime , newWaitTime ) ) ;
public class Span { /** * Returns a Span that covers all columns beginning with a row and { @ link Column } prefix . The * { @ link Column } passed to this method can be constructed without a qualifier or visibility to * create a prefix Span at the family or qualifier level . String parameters will be encoded as * UTF - 8 */ public static Span prefix ( CharSequence row , Column colPrefix ) { } }
Objects . requireNonNull ( row ) ; Objects . requireNonNull ( colPrefix ) ; return prefix ( Bytes . of ( row ) , colPrefix ) ;
public class MediaSessionReceiver { /** * Propagate lock screen event to the player . * @ param context context used to start service . * @ param action action to send . */ private void sendAction ( Context context , String action ) { } }
Intent intent = new Intent ( context , PlaybackService . class ) ; intent . setAction ( action ) ; LocalBroadcastManager . getInstance ( context ) . sendBroadcast ( intent ) ;
public class Parser { /** * Set the " state object " from the parser ( can be used to parse state between parser functions ) . * @ param state * The state object . * @ return The old value of the state object . */ public Object setState ( final Object state ) { } }
final Object oldState = this . state ; this . state = state ; return oldState ;
public class FacesConfigDefaultValidatorsTypeImpl { /** * Creates for all String objects representing < code > validator - id < / code > elements , * a new < code > validator - id < / code > element * @ param values list of < code > validator - id < / code > objects * @ return the current instance of < code > FacesConfigDefaultValidatorsType < T > < / code > */ public FacesConfigDefaultValidatorsType < T > validatorId ( String ... values ) { } }
if ( values != null ) { for ( String name : values ) { childNode . createChild ( "validator-id" ) . text ( name ) ; } } return this ;
public class IOUtil { /** * 简单写入String到OutputStream . */ public static void write ( final String data , final OutputStream output ) throws IOException { } }
if ( data != null ) { output . write ( data . getBytes ( Charsets . UTF_8 ) ) ; }
public class Log { /** * / * package */ static boolean isLoggingEnabled ( String tag , int logLevel ) { } }
// this hashmap lookup might be a little expensive , and so it might make // sense to convert this over to a CopyOnWriteArrayList Integer logLevelForTag = enabledTags . get ( tag ) ; return logLevel >= ( logLevelForTag == null ? INFO : logLevelForTag ) ;
public class Multimap { /** * Returns the total count of all the elements in all values . * @ return */ public int totalCountOfValues ( ) { } }
int count = 0 ; for ( V v : valueMap . values ( ) ) { count += v . size ( ) ; } return count ;
public class JSONUtil { /** * 美化传入的json , 使得该json字符串容易查看 * @ param jsonString 需要处理的json串 * @ return 美化后的json串 */ public static String prettyFormatJson ( String jsonString ) { } }
requireNonNull ( jsonString , "jsonString is null" ) ; return JSON . toJSONString ( getJSONFromString ( jsonString ) , true ) ;
public class CmsWorkplaceConfiguration { /** * Sets the generated workplace manager . < p > * @ param manager the workplace manager to set */ public void setWorkplaceManager ( CmsWorkplaceManager manager ) { } }
m_workplaceManager = manager ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_WORKPLACE_INIT_FINISHED_0 ) ) ; }
public class PdfStamper { /** * Adds a file attachment at the document level . Existing attachments will be kept . * @ param description the file description * @ param fileStore an array with the file . If it ' s < CODE > null < / CODE > * the file will be read from the disk * @ param file the path to the file . It will only be used if * < CODE > fileStore < / CODE > is not < CODE > null < / CODE > * @ param fileDisplay the actual file name stored in the pdf * @ throws IOException on error */ public void addFileAttachment ( String description , byte fileStore [ ] , String file , String fileDisplay ) throws IOException { } }
addFileAttachment ( description , PdfFileSpecification . fileEmbedded ( stamper , file , fileDisplay , fileStore ) ) ;
public class PackageTypeLoader { /** * { @ inheritDoc } */ public Type < T > loadType ( String className ) { } }
for ( String packageName : packages ) { Type < T > type = parent . loadType ( packageName + className ) ; if ( type != null ) return type ; } return null ;
public class Importer { private void addAction ( NamedParameterStatement nps , Map < String , String > keysToColumns , Map < String , Object > [ ] maps ) throws SQLException { } }
Map < String , Object > params = new HashMap < > ( ) ; for ( Map . Entry < String , String > entry : keysToColumns . entrySet ( ) ) { for ( Map < String , Object > map : maps ) { if ( map . containsKey ( entry . getKey ( ) ) ) { params . put ( entry . getValue ( ) , map . get ( entry . getKey ( ) ) ) ; break ; } } } if ( params . size ( ) < keysToColumns . size ( ) ) { Set < String > requiredParams = keysToColumns . keySet ( ) ; requiredParams . removeAll ( params . keySet ( ) ) ; throw new RuntimeException ( String . format ( "Insufficient params: not sent params for query= %s" , requiredParams ) ) ; } nps . setParameters ( params ) ; nps . addBatch ( ) ;
public class AbstractSamlProfileHandlerController { /** * Log cas validation assertion . * @ param assertion the assertion */ protected void logCasValidationAssertion ( final Assertion assertion ) { } }
LOGGER . debug ( "CAS Assertion Valid: [{}]" , assertion . isValid ( ) ) ; LOGGER . debug ( "CAS Assertion Principal: [{}]" , assertion . getPrincipal ( ) . getName ( ) ) ; LOGGER . debug ( "CAS Assertion authentication Date: [{}]" , assertion . getAuthenticationDate ( ) ) ; LOGGER . debug ( "CAS Assertion ValidFrom Date: [{}]" , assertion . getValidFromDate ( ) ) ; LOGGER . debug ( "CAS Assertion ValidUntil Date: [{}]" , assertion . getValidUntilDate ( ) ) ; LOGGER . debug ( "CAS Assertion Attributes: [{}]" , assertion . getAttributes ( ) ) ; LOGGER . debug ( "CAS Assertion Principal Attributes: [{}]" , assertion . getPrincipal ( ) . getAttributes ( ) ) ;
public class EasyGcm { /** * Removes the current registration id effectively forcing the app to register again . * @ param context application ' s context . */ public static void removeRegistrationId ( Context context ) { } }
final SharedPreferences prefs = getGcmPreferences ( context ) ; prefs . edit ( ) . remove ( PROPERTY_REG_ID ) . remove ( PROPERTY_APP_VERSION ) . apply ( ) ;
public class CmdLineProcessor { /** * Add a { @ linkplain CmdLineAction } for switch argument ( { @ code e . g . - - switch } ) processing . * @ param action The { @ linkplain Consumer } to invoke with the argument string . * @ return The created { @ linkplain CmdLineAction } . */ public CmdLineAction onSwitch ( Consumer < @ NonNull String > action ) { } }
SwitchCmdLineAction switchAction = new SwitchCmdLineAction ( action ) ; this . switchActions . add ( switchAction ) ; return switchAction ;
public class CrumbIssuer { /** * Get a crumb from a request parameter and validate it against other data * in the current request . The salt and request parameter that is used is * defined by the current configuration . * @ param request */ public boolean validateCrumb ( ServletRequest request ) { } }
CrumbIssuerDescriptor < CrumbIssuer > desc = getDescriptor ( ) ; String crumbField = desc . getCrumbRequestField ( ) ; String crumbSalt = desc . getCrumbSalt ( ) ; return validateCrumb ( request , crumbSalt , request . getParameter ( crumbField ) ) ;
public class CmsSearchIndexSource { /** * Sets the class name of the indexer . < p > * An Exception is thrown to allow GUI - display of wrong input . < p > * @ param indexerClassName the class name of the indexer * @ throws CmsIllegalArgumentException if the given String is not a fully qualified classname ( within this Java VM ) */ public void setIndexerClassName ( String indexerClassName ) throws CmsIllegalArgumentException { } }
try { m_indexer = ( I_CmsIndexer ) Class . forName ( indexerClassName ) . newInstance ( ) ; m_indexerClassName = indexerClassName ; } catch ( Exception exc ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INDEXER_CREATION_FAILED_1 , m_indexerClassName ) , exc ) ; } throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_INDEXSOURCE_INDEXER_CLASS_NAME_2 , indexerClassName , I_CmsIndexer . class . getName ( ) ) ) ; }
public class Examples { /** * / * retrieve individual mutualfunds sip */ public void getMFSIP ( KiteConnect kiteConnect ) throws KiteException , IOException { } }
System . out . println ( "mf sip: " + kiteConnect . getMFSIP ( "291156521960679" ) . instalments ) ;
public class Wildfly8PluginRegistry { /** * Creates the directory to use for the plugin registry . The location of * the plugin registry is in the Wildfly data directory . */ private static File getPluginDir ( ) { } }
String dataDirPath = System . getProperty ( "jboss.server.data.dir" ) ; // $ NON - NLS - 1 $ File dataDir = new File ( dataDirPath ) ; if ( ! dataDir . isDirectory ( ) ) { throw new RuntimeException ( "Failed to find WildFly data directory at: " + dataDirPath ) ; // $ NON - NLS - 1 $ } File pluginsDir = new File ( dataDir , "apiman/plugins" ) ; // $ NON - NLS - 1 $ return pluginsDir ;
public class DiskInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DiskInfo diskInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( diskInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( diskInfo . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( diskInfo . getPath ( ) , PATH_BINDING ) ; protocolMarshaller . marshall ( diskInfo . getSizeInGb ( ) , SIZEINGB_BINDING ) ; protocolMarshaller . marshall ( diskInfo . getIsSystemDisk ( ) , ISSYSTEMDISK_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AbstractCommandBuilder { /** * Resolves the path relative to the parent and normalizes it . * @ param parent the parent path * @ param path the path * @ return the normalized path */ protected Path normalizePath ( final Path parent , final String path ) { } }
return parent . resolve ( path ) . toAbsolutePath ( ) . normalize ( ) ;
public class CheckStateDrawable { /** * Set the Tint ColorStateList * @ param tintStateList ColorStateList */ public void setColorStateList ( ColorStateList tintStateList ) { } }
if ( tintStateList == null ) tintStateList = ColorStateList . valueOf ( Color . BLACK ) ; mColorStateList = tintStateList ; onStateChange ( getState ( ) ) ;