signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TextUtil { /** * Translate the specified string to upper case and remove the accents . * @ param text is the text to scan . * @ param map is the translation table from an accentuated character to an * unaccentuated character . * @ return the given string without the accents and upper cased */ @ Pure public static String toUpperCaseWithoutAccent ( String text , Map < Character , String > map ) { } }
final StringBuilder buffer = new StringBuilder ( ) ; for ( final char c : text . toCharArray ( ) ) { final String trans = map . get ( c ) ; if ( trans != null ) { buffer . append ( trans . toUpperCase ( ) ) ; } else { buffer . append ( Character . toUpperCase ( c ) ) ; } } return buffer . toString ( ) ;
public class PropertiesUtil { /** * / / / / / 读取Properties / / / / / */ public static Boolean getBoolean ( Properties p , String name , Boolean defaultValue ) { } }
return BooleanUtil . toBooleanObject ( p . getProperty ( name ) , defaultValue ) ;
public class RoleDefinitionsInner { /** * Creates or updates a role definition . * @ param scope The scope of the role definition . * @ param roleDefinitionId The ID of the role definition . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RoleDefinitionInner object */ public Observable < RoleDefinitionInner > createOrUpdateAsync ( String scope , String roleDefinitionId ) { } }
return createOrUpdateWithServiceResponseAsync ( scope , roleDefinitionId ) . map ( new Func1 < ServiceResponse < RoleDefinitionInner > , RoleDefinitionInner > ( ) { @ Override public RoleDefinitionInner call ( ServiceResponse < RoleDefinitionInner > response ) { return response . body ( ) ; } } ) ;
public class SemiTransactionalHiveMetastore { /** * { @ code currentLocation } needs to be supplied if a writePath exists for the table . */ public synchronized void createTable ( ConnectorSession session , Table table , PrincipalPrivileges principalPrivileges , Optional < Path > currentPath , boolean ignoreExisting , PartitionStatistics statistics ) { } }
setShared ( ) ; // When creating a table , it should never have partition actions . This is just a sanity check . checkNoPartitionAction ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; SchemaTableName schemaTableName = new SchemaTableName ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; Action < TableAndMore > oldTableAction = tableActions . get ( schemaTableName ) ; TableAndMore tableAndMore = new TableAndMore ( table , Optional . of ( principalPrivileges ) , currentPath , Optional . empty ( ) , ignoreExisting , statistics , statistics ) ; if ( oldTableAction == null ) { HdfsContext context = new HdfsContext ( session , table . getDatabaseName ( ) , table . getTableName ( ) ) ; tableActions . put ( schemaTableName , new Action < > ( ActionType . ADD , tableAndMore , context ) ) ; return ; } switch ( oldTableAction . getType ( ) ) { case DROP : throw new PrestoException ( TRANSACTION_CONFLICT , "Dropping and then recreating the same table in a transaction is not supported" ) ; case ADD : case ALTER : case INSERT_EXISTING : throw new TableAlreadyExistsException ( schemaTableName ) ; default : throw new IllegalStateException ( "Unknown action type" ) ; }
public class ExpressRouteGatewaysInner { /** * Lists ExpressRoute gateways in a given resource group . * @ param resourceGroupName The name of the resource group . * @ return the observable to the List & lt ; ExpressRouteGatewayInner & gt ; object */ public Observable < Page < ExpressRouteGatewayInner > > listByResourceGroupAsync ( String resourceGroupName ) { } }
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < List < ExpressRouteGatewayInner > > , Page < ExpressRouteGatewayInner > > ( ) { @ Override public Page < ExpressRouteGatewayInner > call ( ServiceResponse < List < ExpressRouteGatewayInner > > response ) { PageImpl1 < ExpressRouteGatewayInner > page = new PageImpl1 < > ( ) ; page . setItems ( response . body ( ) ) ; return page ; } } ) ;
public class Configuration { /** * - - - - - CLIENT PROPERTIES - - - - - */ private HostInfo getClientHost ( ) { } }
String host = AppProperties . get ( SSRKeys . SSR_CLIENT_HOST ) . orElse ( null ) ; if ( isEmpty ( host ) ) { logger . info ( "Client host not provided using '{}' to discover host address" , discovery . getClass ( ) . getSimpleName ( ) ) ; return discovery . resolveHost ( ) ; } else { logger . info ( "Client host provided: {}" , host ) ; InetAddress address = tryParse ( host ) ; if ( address != null ) { return new HostInfo ( address . getHostAddress ( ) , address . getHostName ( ) ) ; } return new HostInfo ( host , host ) ; }
public class Response { /** * 设置响应的Header * @ param name 名 * @ param value 值 , 可以是String , Date , int */ public static void setHeader ( String name , Object value ) { } }
ServletUtil . setHeader ( getServletResponse ( ) , name , value ) ;
public class ReflectionUtils { /** * Looks up a constructor that is explicitly identified . This method should only * be used for constructors that definitely exist . It does not throw the checked * NoSuchMethodException . If the constructor does not exist , it will instead fail * with an unchecked IllegalArgumentException . * @ param < T > The type of object that the constructor creates . * @ param aClass The class in which the constructor exists . * @ param paramTypes The types of the constructor ' s parameters . * @ return The identified constructor . */ public static < T > Constructor < T > findKnownConstructor ( Class < T > aClass , Class < ? > ... paramTypes ) { } }
try { return aClass . getConstructor ( paramTypes ) ; } catch ( NoSuchMethodException ex ) { // This cannot happen if the method is correctly identified . throw new IllegalArgumentException ( "Specified constructor does not exist in class " + aClass . getName ( ) , ex ) ; }
public class MisoScenePanel { /** * Reports the memory usage of the resolved tiles in the current scene block . */ public void reportMemoryUsage ( ) { } }
Map < Tile . Key , BaseTile > base = Maps . newHashMap ( ) ; Set < BaseTile > fringe = Sets . newHashSet ( ) ; Map < Tile . Key , ObjectTile > object = Maps . newHashMap ( ) ; long [ ] usage = new long [ 3 ] ; for ( SceneBlock block : _blocks . values ( ) ) { block . computeMemoryUsage ( base , fringe , object , usage ) ; } log . info ( "Scene tile memory usage" , "scene" , StringUtil . shortClassName ( this ) , "base" , base . size ( ) + "->" + ( usage [ 0 ] / 1024 ) + "k" , "fringe" , fringe . size ( ) + "->" + ( usage [ 1 ] / 1024 ) + "k" , "obj" , object . size ( ) + "->" + ( usage [ 2 ] / 1024 ) + "k" ) ;
public class CronDefinitionBuilder { /** * Registers a certain FieldDefinition . * @ param definition - FieldDefinition instance , never null */ public void register ( final FieldDefinition definition ) { } }
// ensure that we can ' t register a mandatory definition if there are already optional ones boolean hasOptionalField = false ; for ( final FieldDefinition fieldDefinition : fields . values ( ) ) { if ( fieldDefinition . isOptional ( ) ) { hasOptionalField = true ; break ; } } if ( ! definition . isOptional ( ) && hasOptionalField ) { throw new IllegalArgumentException ( "Can't register mandatory definition after a optional definition." ) ; } fields . put ( definition . getFieldName ( ) , definition ) ;
public class MacUtils { /** * Return a 6 byte array where each byte represents a value in the MAC * address of the first valid interface found or an * { @ link UnsupportedOperationException } is thrown if an error occurs . */ public static byte [ ] realMacAddress ( ) { } }
byte [ ] mac = null ; try { // enumerations are wonky . . . Enumeration < NetworkInterface > networkInterfaces = getNetworkInterfaces ( ) ; while ( networkInterfaces . hasMoreElements ( ) ) { NetworkInterface n = networkInterfaces . nextElement ( ) ; byte [ ] possibleMac = n . getHardwareAddress ( ) ; if ( possibleMac != null && possibleMac . length == 6 ) { mac = possibleMac ; break ; } } if ( mac == null ) { throw new UnsupportedOperationException ( "Could not retrieve hardware MAC address, no MAC addresses detected" ) ; } } catch ( SocketException e ) { throw new UnsupportedOperationException ( "Could not retrieve hardware MAC address, SocketException occurred" , e ) ; } return mac ;
public class CommerceNotificationTemplateUtil { /** * Returns the commerce notification template where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce notification template , or < code > null < / code > if a matching commerce notification template could not be found */ public static CommerceNotificationTemplate fetchByUUID_G ( String uuid , long groupId , boolean retrieveFromCache ) { } }
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class Font { /** * Translates a < CODE > String < / CODE > - value of a certain family into the * index that is used for this family in this class . * @ param family * A < CODE > String < / CODE > representing a certain font - family * @ return the corresponding index */ public static int getFamilyIndex ( String family ) { } }
if ( family . equalsIgnoreCase ( FontFactory . COURIER ) ) { return COURIER ; } if ( family . equalsIgnoreCase ( FontFactory . HELVETICA ) ) { return HELVETICA ; } if ( family . equalsIgnoreCase ( FontFactory . TIMES_ROMAN ) ) { return TIMES_ROMAN ; } if ( family . equalsIgnoreCase ( FontFactory . SYMBOL ) ) { return SYMBOL ; } if ( family . equalsIgnoreCase ( FontFactory . ZAPFDINGBATS ) ) { return ZAPFDINGBATS ; } return UNDEFINED ;
public class VoltFile { /** * Merge one directory into another via copying . Useful for simulating * node removal or files being moved from node to node or duplicated . */ public static void moveSubRootContents ( File fromSubRoot , File toSubRoot ) throws IOException { } }
assert ( fromSubRoot . exists ( ) && fromSubRoot . isDirectory ( ) ) ; assert ( toSubRoot . exists ( ) && toSubRoot . isDirectory ( ) ) ; for ( File file : fromSubRoot . listFiles ( ) ) { File fInOtherSubroot = new File ( toSubRoot , file . getName ( ) ) ; if ( file . isDirectory ( ) ) { if ( ! fInOtherSubroot . exists ( ) ) { if ( ! fInOtherSubroot . mkdir ( ) ) { throw new IOException ( "Can't create directory " + fInOtherSubroot ) ; } } moveSubRootContents ( file , fInOtherSubroot ) ; } else { if ( fInOtherSubroot . exists ( ) ) { throw new IOException ( fInOtherSubroot + " already exists" ) ; } if ( ! fInOtherSubroot . createNewFile ( ) ) { throw new IOException ( ) ; } FileInputStream fis = new FileInputStream ( file ) ; FileOutputStream fos = new FileOutputStream ( fInOtherSubroot ) ; FileChannel inputChannel = fis . getChannel ( ) ; FileChannel outputChannel = fos . getChannel ( ) ; BBContainer bufC = DBBPool . allocateDirect ( 8192 ) ; ByteBuffer buf = bufC . b ( ) ; try { while ( inputChannel . read ( buf ) != - 1 ) { buf . flip ( ) ; outputChannel . write ( buf ) ; buf . clear ( ) ; } } finally { // These calls to close ( ) also close the channels . fis . close ( ) ; fos . close ( ) ; bufC . discard ( ) ; } } }
public class lbwlm { /** * Use this API to fetch all the lbwlm resources that are configured on netscaler . */ public static lbwlm [ ] get ( nitro_service service , options option ) throws Exception { } }
lbwlm obj = new lbwlm ( ) ; lbwlm [ ] response = ( lbwlm [ ] ) obj . get_resources ( service , option ) ; return response ;
public class Consumers { /** * Yields nth ( 1 - based ) element of the iterable . * @ param < E > the iterable element type * @ param count the element cardinality * @ param iterable the iterable that will be consumed * @ return the nth element */ public static < E > E nth ( long count , Iterable < E > iterable ) { } }
dbc . precondition ( iterable != null , "cannot call nth with a null iterable" ) ; final Iterator < E > filtered = new FilteringIterator < E > ( iterable . iterator ( ) , new Nth < E > ( count ) ) ; return new FirstElement < E > ( ) . apply ( filtered ) ;
public class CommsInboundChain { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . channelfw . ChainEventListener # chainStopped ( com . ibm . websphere . channelfw . ChainData ) */ @ Override public void chainStopped ( ChainData chainData ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "chainStopped" , chainData ) ; chainState . set ( ChainState . STOPPED . val ) ; // Wake up anything waiting for the chain to stop // ( see the update method for one example ) stopWait . notifyStopped ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "chainStopped" ) ;
public class FnJodaTimeUtils { /** * It creates an { @ link Interval } from the input { @ link Calendar } targets used as the start and end . * The { @ link Interval } will be created with the given { @ link Chronology } * @ param chronology { @ link Chronology } to be used * @ return the { @ link Interval } created from the input and arguments */ public static final Function < Collection < ? extends Calendar > , Interval > calendarFieldCollectionToInterval ( Chronology chronology ) { } }
return FnInterval . calendarFieldCollectionToInterval ( chronology ) ;
public class DescribeVTLDevicesResult { /** * An array of VTL device objects composed of the Amazon Resource Name ( ARN ) of the VTL devices . * @ param vTLDevices * An array of VTL device objects composed of the Amazon Resource Name ( ARN ) of the VTL devices . */ public void setVTLDevices ( java . util . Collection < VTLDevice > vTLDevices ) { } }
if ( vTLDevices == null ) { this . vTLDevices = null ; return ; } this . vTLDevices = new com . amazonaws . internal . SdkInternalList < VTLDevice > ( vTLDevices ) ;
public class ExtensionList { /** * Write access will put the instance into a legacy store . * @ deprecated since 2009-02-23. * Prefer automatic registration . */ @ Override @ Deprecated public boolean add ( T t ) { } }
try { return addSync ( t ) ; } finally { if ( extensions != null ) { fireOnChangeListeners ( ) ; } }
public class Collections { /** * Returns a dynamically typesafe view of the specified sorted set . * Any attempt to insert an element of the wrong type will result in an * immediate { @ link ClassCastException } . Assuming a sorted set * contains no incorrectly typed elements prior to the time a * dynamically typesafe view is generated , and that all subsequent * access to the sorted set takes place through the view , it is * < i > guaranteed < / i > that the sorted set cannot contain an incorrectly * typed element . * < p > A discussion of the use of dynamically typesafe views may be * found in the documentation for the { @ link # checkedCollection * checkedCollection } method . * < p > The returned sorted set will be serializable if the specified sorted * set is serializable . * < p > Since { @ code null } is considered to be a value of any reference * type , the returned sorted set permits insertion of null elements * whenever the backing sorted set does . * @ param < E > the class of the objects in the set * @ param s the sorted set for which a dynamically typesafe view is to be * returned * @ param type the type of element that { @ code s } is permitted to hold * @ return a dynamically typesafe view of the specified sorted set * @ since 1.5 */ public static < E > SortedSet < E > checkedSortedSet ( SortedSet < E > s , Class < E > type ) { } }
return new CheckedSortedSet < > ( s , type ) ;
public class JMXRESTProxyServlet { /** * For any request URL other than the context root , delegate to the * appropriate handler . If no handler is available , a 404 will be set * into the response . * @ param request * @ param response * @ param pathInfo * @ throws IOException */ private void handleWithDelegate ( final HttpServletRequest request , final HttpServletResponse response ) throws IOException { } }
// Delegate to handler boolean foundHandler = REST_HANDLER_CONTAINER . handleRequest ( new ServletRESTRequestImpl ( request ) , new ServletRESTResponseImpl ( response ) ) ; if ( ! foundHandler ) { // No handler found , so we send back a 404 " not found " response . String errorMsg = TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . TRACE_BUNDLE_CORE , "HANDLER_NOT_FOUND_ERROR" , new Object [ ] { request . getRequestURI ( ) } , "CWWKO1000E: There are no registered handlers that match the requested URL {0}" ) ; response . sendError ( HttpServletResponse . SC_NOT_FOUND , errorMsg ) ; }
public class ReplicatedHashMap { /** * Removes all of the mappings from this map . */ public void clear ( ) { } }
try { MethodCall call = new MethodCall ( CLEAR ) ; disp . callRemoteMethods ( null , call , call_options ) ; } catch ( Exception e ) { throw new RuntimeException ( "clear() failed" , e ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCivilElement ( ) { } }
if ( ifcCivilElementEClass == null ) { ifcCivilElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 94 ) ; } return ifcCivilElementEClass ;
public class MarshallableTypeHints { /** * Get the serialized form size predictor for a particular type . * @ param type Marshallable type for which serialized form size will be predicted * @ return an instance of { @ link BufferSizePredictor } */ public BufferSizePredictor getBufferSizePredictor ( Class < ? > type ) { } }
MarshallingType marshallingType = typeHints . get ( type ) ; if ( marshallingType == null ) { // Initialise with isMarshallable to null , meaning it ' s unknown marshallingType = new MarshallingType ( null , new AdaptiveBufferSizePredictor ( ) ) ; MarshallingType prev = typeHints . putIfAbsent ( type , marshallingType ) ; if ( prev != null ) { marshallingType = prev ; } else { if ( trace ) { log . tracef ( "Cache a buffer size predictor for '%s' assuming " + "its serializability is unknown" , type . getName ( ) ) ; } } } return marshallingType . sizePredictor ;
public class RedisClient { /** * Returns encoded bytes . * @ param name * field name . * @ return encoded byte array . */ byte [ ] getEncodedBytes ( final String name ) { } }
try { if ( name != null ) { return name . getBytes ( Constants . CHARSET_UTF8 ) ; } } catch ( UnsupportedEncodingException e ) { logger . error ( "Error during persist, Caused by:" , e ) ; throw new PersistenceException ( e ) ; } return null ;
public class ConformerContainer { /** * Returns the lowest index at which the specific IAtomContainer appears in the list or - 1 if is not found . * A given IAtomContainer will occur in the list if the title matches the stored title for * the conformers in this container and if the coordinates for each atom in the specified molecule * are equal to the coordinates of the corresponding atoms in a conformer . * @ param o The IAtomContainer whose presence is being tested * @ return The index where o was found */ @ Override public int indexOf ( Object o ) { } }
IAtomContainer atomContainer = ( IAtomContainer ) o ; if ( ! atomContainer . getTitle ( ) . equals ( title ) ) return - 1 ; if ( atomContainer . getAtomCount ( ) != this . atomContainer . getAtomCount ( ) ) return - 1 ; boolean coordsMatch ; int index = 0 ; for ( Point3d [ ] coords : coordinates ) { coordsMatch = true ; for ( int i = 0 ; i < atomContainer . getAtomCount ( ) ; i ++ ) { Point3d p = atomContainer . getAtom ( i ) . getPoint3d ( ) ; if ( ! ( p . x == coords [ i ] . x && p . y == coords [ i ] . y && p . z == coords [ i ] . z ) ) { coordsMatch = false ; break ; } } if ( coordsMatch ) return index ; index ++ ; } return - 1 ;
public class PostgreSqlRepositoryCollection { /** * Updates database column based on attribute changes . * @ param entityType entity meta data * @ param attr current attribute * @ param updatedAttr updated attribute */ private void updateColumn ( EntityType entityType , Attribute attr , Attribute updatedAttr ) { } }
// nullable changes if ( ! Objects . equals ( attr . isNillable ( ) , updatedAttr . isNillable ( ) ) ) { updateNillable ( entityType , attr , updatedAttr ) ; } // unique changes if ( ! Objects . equals ( attr . isUnique ( ) , updatedAttr . isUnique ( ) ) ) { updateUnique ( entityType , attr , updatedAttr ) ; } // readonly changes if ( ! Objects . equals ( attr . isReadOnly ( ) , updatedAttr . isReadOnly ( ) ) ) { updateReadonly ( entityType , attr , updatedAttr ) ; } // data type changes if ( ! Objects . equals ( attr . getDataType ( ) , updatedAttr . getDataType ( ) ) ) { if ( updatedAttr . isReadOnly ( ) ) { dropTableTriggers ( entityType ) ; } updateDataType ( entityType , attr , updatedAttr ) ; if ( updatedAttr . isReadOnly ( ) ) { createTableTriggers ( entityType ) ; } } // ref entity changes if ( attr . hasRefEntity ( ) && updatedAttr . hasRefEntity ( ) && ! attr . getRefEntity ( ) . getId ( ) . equals ( updatedAttr . getRefEntity ( ) . getId ( ) ) ) { updateRefEntity ( entityType , attr , updatedAttr ) ; } // enum option changes if ( ! Objects . equals ( attr . getEnumOptions ( ) , updatedAttr . getEnumOptions ( ) ) ) { updateEnumOptions ( entityType , attr , updatedAttr ) ; }
public class FJIterate { /** * Same effect as { @ link Iterate # collect ( Iterable , Function ) } , but executed in parallel batches , * and with potentially reordered result . * @ param allowReorderedResult If the result can be in a different order . * Allowing reordering may yield faster execution . * @ return The collected elements . The Collection will be of the same type * ( List or Set ) as the input . */ public static < T , V > Collection < V > collect ( Iterable < T > iterable , Function < ? super T , V > function , boolean allowReorderedResult ) { } }
return FJIterate . collect ( iterable , function , null , allowReorderedResult ) ;
public class Mutator { /** * Creates a superset of the input Schema , taking all the Fields in the input schema * and adding some new ones . The new fields are fully specified in a Field class . * The name of the schema is auto - generated with a static counter . */ public static Schema superSetOf ( Schema schema , Field ... newFields ) { } }
return superSetOf ( "superSetSchema" + ( COUNTER ++ ) , schema , newFields ) ;
public class CacheCore { /** * compatible with heron : : tmaster : : TMetricsCollector * @ param metrics The metrics to be added */ public void addMetricException ( TopologyMaster . PublishMetrics metrics ) { } }
synchronized ( CacheCore . class ) { for ( TopologyMaster . MetricDatum metricDatum : metrics . getMetricsList ( ) ) { addMetric ( metricDatum ) ; } for ( TopologyMaster . TmasterExceptionLog exceptionLog : metrics . getExceptionsList ( ) ) { addException ( exceptionLog ) ; } }
public class EnumLookup { /** * Finds the given ID and returns the corresponding enumerate value */ public K find ( final V id ) { } }
final V keyValue = keyForValue ( id ) ; if ( inverse . containsKey ( keyValue ) ) { return inverse . get ( keyValue ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Enum with value " + id + " not found" ) ; } return null ;
public class CommonOps_DDF2 { /** * Performs an in - place element by element scalar division . Scalar denominator . < br > * < br > * a < sub > ij < / sub > = a < sub > ij < / sub > / & alpha ; * @ param a The matrix whose elements are to be divided . Modified . * @ param alpha the amount each element is divided by . */ public static void divide ( DMatrix2x2 a , double alpha ) { } }
a . a11 /= alpha ; a . a12 /= alpha ; a . a21 /= alpha ; a . a22 /= alpha ;
public class XmlStringBuilder { /** * Add the given attribute if { @ code value = > 0 } . * @ param name * @ param value * @ return a reference to this object */ public XmlStringBuilder optIntAttribute ( String name , int value ) { } }
if ( value >= 0 ) { attribute ( name , Integer . toString ( value ) ) ; } return this ;
public class DOValidatorModule { /** * Validates a digital object . * @ param objectAsFile * The digital object provided as a file . * @ param validationType * The level of validation to perform on the digital object . This is * an integer from 0-2 with the following meanings : 0 = VALIDATE _ ALL * ( do all validation levels ) 1 = VALIDATE _ XML _ SCHEMA ( perform only * XML Schema validation ) 2 = VALIDATE _ SCHEMATRON ( perform only * Schematron Rules validation ) * @ param phase * The stage in the work flow for which the validation should be * contextualized . " ingest " = the object is in the submission format * for the ingest stage phase " store " = the object is in the * authoritative format for the final storage phase * @ throws ServerException * If validation fails for any reason . */ public void validate ( File objectAsFile , String format , int validationType , String phase ) throws ServerException { } }
dov . validate ( objectAsFile , format , validationType , phase ) ;
public class PlatformDeviceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PlatformDevice platformDevice , ProtocolMarshaller protocolMarshaller ) { } }
if ( platformDevice == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( platformDevice . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( platformDevice . getType ( ) , TYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class UnilateralSortMerger { @ Override public MutableObjectIterator < E > getIterator ( ) throws InterruptedException { } }
synchronized ( this . iteratorLock ) { // wait while both the iterator and the exception are not set while ( this . iterator == null && this . iteratorException == null ) { this . iteratorLock . wait ( ) ; } if ( this . iteratorException != null ) { throw new RuntimeException ( "Error obtaining the sorted input: " + this . iteratorException . getMessage ( ) , this . iteratorException ) ; } else { return this . iterator ; } }
public class AgentsClient { /** * Exports the specified agent to a ZIP file . * < p > Operation & lt ; response : * [ ExportAgentResponse ] [ google . cloud . dialogflow . v2 . ExportAgentResponse ] & gt ; * < p > Sample code : * < pre > < code > * try ( AgentsClient agentsClient = AgentsClient . create ( ) ) { * ProjectName parent = ProjectName . of ( " [ PROJECT ] " ) ; * ExportAgentResponse response = agentsClient . exportAgentAsync ( parent . toString ( ) ) . get ( ) ; * < / code > < / pre > * @ param parent Required . The project that the agent to export is associated with . Format : * ` projects / & lt ; Project ID & gt ; ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi ( "The surface for long-running operations is not stable yet and may change in the future." ) public final OperationFuture < ExportAgentResponse , Struct > exportAgentAsync ( String parent ) { } }
ExportAgentRequest request = ExportAgentRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return exportAgentAsync ( request ) ;
public class StringUtil { /** * 如果字符串是 < code > null < / code > 或空字符串 < code > " " < / code > , 则返回指定默认字符串 , 否则返回字符串本身 。 * < pre > * StringUtil . defaultIfEmpty ( null , " default " ) = " default " * StringUtil . defaultIfEmpty ( " " , " default " ) = " default " * StringUtil . defaultIfEmpty ( " " , " default " ) = " " * StringUtil . defaultIfEmpty ( " bat " , " default " ) = " bat " * < / pre > * @ param str 要转换的字符串 * @ param defaultStr 默认字符串 * @ return 字符串本身或指定的默认字符串 */ public static String defaultIfEmpty ( String str , String defaultStr ) { } }
return str == null || str . length ( ) == 0 ? defaultStr : str ;
public class MessageFormat { /** * < strong > [ icu ] < / strong > Parses text from the beginning of the given string to produce a map from * argument to values . The method may not use the entire text of the given string . * < p > See the { @ link # parse ( String , ParsePosition ) } method for more information on * message parsing . * @ param source A < code > String < / code > whose beginning should be parsed . * @ return A < code > Map < / code > parsed from the string . * @ throws ParseException if the beginning of the specified string cannot * be parsed . * @ see # parseToMap ( String , ParsePosition ) */ public Map < String , Object > parseToMap ( String source ) throws ParseException { } }
ParsePosition pos = new ParsePosition ( 0 ) ; Map < String , Object > result = new HashMap < String , Object > ( ) ; parse ( 0 , source , pos , null , result ) ; if ( pos . getIndex ( ) == 0 ) // unchanged , returned object is null throw new ParseException ( "MessageFormat parse error!" , pos . getErrorIndex ( ) ) ; return result ;
public class RegistryManagerImpl { /** * Imports a new service within iServe . The original document is stored * in the server and the transformed version registered within iServe . * @ param servicesContentStream * @ param mediaType * @ return the List of URIs of the services imported * @ throws SalException */ @ Override public List < URI > importServices ( InputStream servicesContentStream , String mediaType ) throws SalException { } }
boolean isNativeFormat = MediaType . NATIVE_MEDIATYPE_SYNTAX_MAP . containsKey ( mediaType ) ; // Throw error if Format Unsupported if ( ! isNativeFormat && ! this . serviceTransformationEngine . canTransform ( mediaType ) ) { log . error ( "The media type {} is not natively supported and has no suitable transformer." , mediaType ) ; throw new ServiceException ( "Unable to import service. Format unsupported." ) ; } // Obtain the file extension to use String fileExtension = findFileExtensionToUse ( mediaType , isNativeFormat ) ; List < Service > services = null ; List < URI > importedServices = new ArrayList < URI > ( ) ; URI sourceDocUri = null ; InputStream localStream = null ; try { // 1st Store the document sourceDocUri = this . docManager . createDocument ( servicesContentStream , fileExtension , mediaType ) ; if ( sourceDocUri == null ) { throw new ServiceException ( "Unable to save service document. Operation aborted." ) ; } // 2nd Parse and Transform the document // The original stream may be a one - of stream so save it first and read locally localStream = this . docManager . getDocument ( sourceDocUri ) ; services = getServicesFromStream ( mediaType , isNativeFormat , localStream ) ; // 3rd - Store the resulting MSM services . There may be more than one URI serviceUri = null ; if ( services != null && ! services . isEmpty ( ) ) { log . info ( "Importing {} services" , services . size ( ) ) ; for ( Service service : services ) { // The service is being imported - > update the source service . setSource ( sourceDocUri ) ; serviceUri = this . serviceManager . addService ( service ) ; if ( serviceUri != null ) { importedServices . add ( serviceUri ) ; } } } // 4th Log it was all done correctly // TODO : log to the system and notify observers log . info ( "Source document imported: {}" , sourceDocUri . toASCIIString ( ) ) ; } finally { // Rollback if something went wrong if ( ( services == null || ( services != null && services . size ( ) != importedServices . size ( ) ) ) && sourceDocUri != null ) { this . docManager . deleteDocument ( sourceDocUri ) ; for ( URI svcUri : importedServices ) { this . serviceManager . deleteService ( svcUri ) ; } log . warn ( "There were problems importing the service. Changes undone." ) ; } if ( localStream != null ) try { localStream . close ( ) ; } catch ( IOException e ) { log . error ( "Error closing the service content stream" , e ) ; } } return importedServices ;
public class Tsurgeon { /** * Parses a tsurgeon script text input and compiles a tregex pattern and a list * of tsurgeon operations into a pair . * @ param reader Reader to read patterns from * @ return A pair of a tregex and tsurgeon pattern read from a file , or < code > null < / code > * when the operations in the Reader have been exhausted * @ throws IOException If any IO problem */ public static Pair < TregexPattern , TsurgeonPattern > getOperationFromReader ( BufferedReader reader , TregexPatternCompiler compiler ) throws IOException { } }
String patternString = getPatternFromFile ( reader ) ; // System . err . println ( " Read tregex pattern : " + patternString ) ; if ( "" . equals ( patternString ) ) { return null ; } TregexPattern matchPattern = compiler . compile ( patternString ) ; TsurgeonPattern collectedPattern = getTsurgeonOperationsFromReader ( reader ) ; return new Pair < TregexPattern , TsurgeonPattern > ( matchPattern , collectedPattern ) ;
public class ArrayUtil { /** * find a object in array * @ param array * @ param object object to find * @ return position in array or 0 */ public static int find ( Array array , Object object ) { } }
int len = array . size ( ) ; for ( int i = 1 ; i <= len ; i ++ ) { Object tmp = array . get ( i , null ) ; try { if ( tmp != null && Operator . compare ( object , tmp ) == 0 ) return i ; } catch ( PageException e ) { } } return 0 ;
public class FloatingLabelInstantPicker { /** * Refreshes the widget state when the selection changes */ protected void onSelectedInstantChanged ( ) { } }
if ( selectedInstant == null ) { getInputWidget ( ) . setText ( "" ) ; anchorLabel ( ) ; } else { getInputWidget ( ) . setText ( getInstantPrinter ( ) . print ( selectedInstant ) ) ; floatLabel ( ) ; } if ( instantPickerListener != null ) instantPickerListener . onInstantChanged ( this , selectedInstant ) ;
public class JobConf { /** * Get the value class for the map output data . If it is not set , use the * ( final ) output value class This allows the map output value class to be * different than the final output value class . * @ return the map output value class . */ public Class < ? > getMapOutputValueClass ( ) { } }
Class < ? > retv = getClass ( "mapred.mapoutput.value.class" , null , Object . class ) ; if ( retv == null ) { retv = getOutputValueClass ( ) ; } return retv ;
public class BlobServicesInner { /** * Gets the properties of a storage account ’ s Blob service , including properties for Storage Analytics and CORS ( Cross - Origin Resource Sharing ) rules . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < BlobServicePropertiesInner > getServicePropertiesAsync ( String resourceGroupName , String accountName , final ServiceCallback < BlobServicePropertiesInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getServicePropertiesWithServiceResponseAsync ( resourceGroupName , accountName ) , serviceCallback ) ;
public class JBBPUtils { /** * Reverse order of bytes in a byte array . * @ param nullableArrayToBeInverted a byte array which order must be reversed , * it can be null * @ return the same array instance but with reversed byte order , null if the * source array is null * @ since 1.1 */ public static byte [ ] reverseArray ( final byte [ ] nullableArrayToBeInverted ) { } }
if ( nullableArrayToBeInverted != null && nullableArrayToBeInverted . length > 0 ) { int indexStart = 0 ; int indexEnd = nullableArrayToBeInverted . length - 1 ; while ( indexStart < indexEnd ) { final byte a = nullableArrayToBeInverted [ indexStart ] ; nullableArrayToBeInverted [ indexStart ] = nullableArrayToBeInverted [ indexEnd ] ; nullableArrayToBeInverted [ indexEnd ] = a ; indexStart ++ ; indexEnd -- ; } } return nullableArrayToBeInverted ;
public class JSDocInfo { /** * Get the message for a given thrown type . */ public String getThrowsDescriptionForType ( JSTypeExpression type ) { } }
if ( documentation == null || documentation . throwsDescriptions == null ) { return null ; } return documentation . throwsDescriptions . get ( type ) ;
public class WorldMapTileSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
super . initGraphics ( ) ; poiLocations = FXCollections . observableHashMap ( ) ; chartDataLocations = FXCollections . observableHashMap ( ) ; handlerMap = new HashMap < > ( ) ; circleHandlerMap = new HashMap < > ( ) ; countryPaths = tile . getCountryPaths ( ) ; String formatString = new StringBuilder ( "%." ) . append ( tile . getDecimals ( ) ) . append ( "f" ) . toString ( ) ; poiListener = new WeakListChangeListener < > ( change -> { while ( change . next ( ) ) { if ( change . wasAdded ( ) ) { change . getAddedSubList ( ) . forEach ( addedPoi -> { String tooltipText = new StringBuilder ( addedPoi . getName ( ) ) . append ( "\n" ) . append ( addedPoi . getInfo ( ) ) . toString ( ) ; EventHandler < MouseEvent > handler = e -> addedPoi . fireLocationEvent ( new LocationEvent ( addedPoi ) ) ; Circle circle = new Circle ( 3 , addedPoi . getColor ( ) ) ; Tooltip . install ( circle , new Tooltip ( tooltipText ) ) ; circleHandlerMap . put ( circle , handler ) ; poiLocations . put ( addedPoi , circle ) ; circle . setOnMousePressed ( handler ) ; getPane ( ) . getChildren ( ) . add ( circle ) ; } ) ; } else if ( change . wasRemoved ( ) ) { change . getRemoved ( ) . forEach ( removedPoi -> { if ( circleHandlerMap . get ( removedPoi ) != null ) { poiLocations . get ( removedPoi ) . removeEventHandler ( MouseEvent . MOUSE_PRESSED , circleHandlerMap . get ( removedPoi ) ) ; } getPane ( ) . getChildren ( ) . remove ( removedPoi ) ; } ) ; } } resize ( ) ; } ) ; chartDataListener = new WeakListChangeListener < > ( change -> { while ( change . next ( ) ) { if ( change . wasAdded ( ) ) { change . getAddedSubList ( ) . forEach ( addedData -> { String tooltipText = new StringBuilder ( addedData . getName ( ) ) . append ( "\n" ) . append ( String . format ( Locale . US , formatString , addedData . getValue ( ) ) ) . toString ( ) ; EventHandler < MouseEvent > handler = e -> tile . fireTileEvent ( new TileEvent ( EventType . SELECTED_CHART_DATA , addedData ) ) ; Circle circle = new Circle ( 3 , addedData . getLocation ( ) . getColor ( ) ) ; Tooltip . install ( circle , new Tooltip ( tooltipText ) ) ; circleHandlerMap . put ( circle , handler ) ; chartDataLocations . put ( addedData . getLocation ( ) , circle ) ; circle . setOnMousePressed ( handler ) ; getPane ( ) . getChildren ( ) . add ( circle ) ; } ) ; } else if ( change . wasRemoved ( ) ) { change . getRemoved ( ) . forEach ( removedData -> { if ( circleHandlerMap . get ( removedData ) != null ) { chartDataLocations . get ( removedData ) . removeEventHandler ( MouseEvent . MOUSE_PRESSED , circleHandlerMap . get ( removedData ) ) ; } getPane ( ) . getChildren ( ) . remove ( removedData ) ; } ) ; } } resize ( ) ; } ) ; tile . getPoiList ( ) . forEach ( poi -> { String tooltipText = new StringBuilder ( poi . getName ( ) ) . append ( "\n" ) . append ( poi . getInfo ( ) ) . toString ( ) ; Circle circle = new Circle ( 3 , poi . getColor ( ) ) ; circle . setOnMousePressed ( e -> poi . fireLocationEvent ( new LocationEvent ( poi ) ) ) ; Tooltip . install ( circle , new Tooltip ( tooltipText ) ) ; poiLocations . put ( poi , circle ) ; } ) ; tile . getChartData ( ) . stream ( ) . filter ( chartData -> chartData . getLocation ( ) != null ) . forEach ( chartData -> { String tooltipText = new StringBuilder ( chartData . getName ( ) ) . append ( "\n" ) . append ( String . format ( Locale . US , formatString , chartData . getValue ( ) ) ) . toString ( ) ; Circle circle = new Circle ( 3 , chartData . getLocation ( ) . getColor ( ) ) ; circle . setOnMousePressed ( e -> tile . fireTileEvent ( new TileEvent ( EventType . SELECTED_CHART_DATA , chartData ) ) ) ; Tooltip . install ( circle , new Tooltip ( tooltipText ) ) ; chartDataLocations . put ( chartData . getLocation ( ) , circle ) ; } ) ; titleText = new Text ( ) ; titleText . setFill ( tile . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! tile . getTitle ( ) . isEmpty ( ) ) ; text = new Text ( tile . getUnit ( ) ) ; text . setFill ( tile . getUnitColor ( ) ) ; Helper . enableNode ( text , tile . isTextVisible ( ) ) ; Color fill = tile . getForegroundColor ( ) ; Color stroke = tile . getBackgroundColor ( ) ; worldPane = new Pane ( ) ; countryPaths . forEach ( ( name , pathList ) -> { Country country = Country . valueOf ( name ) ; pathList . forEach ( path -> { path . setFill ( null == country . getColor ( ) ? fill : country . getColor ( ) ) ; path . setStroke ( stroke ) ; path . setStrokeWidth ( 0.2 ) ; } ) ; worldPane . getChildren ( ) . addAll ( pathList ) ; } ) ; group = new Group ( worldPane ) ; getPane ( ) . getChildren ( ) . addAll ( group , titleText , text ) ; getPane ( ) . getChildren ( ) . addAll ( chartDataLocations . values ( ) ) ; getPane ( ) . getChildren ( ) . addAll ( poiLocations . values ( ) ) ;
public class PeasyViewHolder { /** * Static method to help inflate parent view with layoutId * @ param inflater inflater * @ param parent parent * @ param layoutId layoutId * @ return View */ public static View inflateView ( LayoutInflater inflater , ViewGroup parent , int layoutId ) { } }
return inflater . inflate ( layoutId , parent , false ) ;
public class AsyncConnection { /** * 创建TCP协议客户端连接 * @ param context Context * @ param address 连接点子 * @ param group 连接AsynchronousChannelGroup * @ param readTimeoutSeconds 读取超时秒数 * @ param writeTimeoutSeconds 写入超时秒数 * @ return 连接CompletableFuture */ public static CompletableFuture < AsyncConnection > createTCP ( final Context context , final AsynchronousChannelGroup group , final SocketAddress address , final int readTimeoutSeconds , final int writeTimeoutSeconds ) { } }
return createTCP ( context . getBufferSupplier ( ) , context . getBufferConsumer ( ) , group , context . getSSLContext ( ) , address , readTimeoutSeconds , writeTimeoutSeconds ) ;
public class AbstractRequest { /** * 执行http请求 * @ param getMethod * @ return * @ throws IOException */ @ SuppressWarnings ( "deprecation" ) private final HttpResponse executeHttpRequest ( HttpGet getMethod , String host ) throws Exception { } }
SSLContext sslContext = SSLContexts . custom ( ) . loadTrustMaterial ( null , new TrustStrategy ( ) { @ Override public boolean isTrusted ( X509Certificate [ ] arg0 , String arg1 ) throws CertificateException { return true ; } } ) . build ( ) ; SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory ( sslContext , new String [ ] { "TLSv1" } , null , SSLConnectionSocketFactory . ALLOW_ALL_HOSTNAME_VERIFIER ) ; Registry registry = RegistryBuilder . create ( ) . register ( "http" , PlainConnectionSocketFactory . INSTANCE ) . register ( "https" , sslsf ) . build ( ) ; HttpClientConnectionManager httpClientConnectionManager = new PoolingHttpClientConnectionManager ( registry ) ; CloseableHttpClient httpClient = HttpClientBuilder . create ( ) . setMaxConnPerRoute ( 50 ) . setMaxConnTotal ( 100 ) . setConnectionManager ( httpClientConnectionManager ) . build ( ) ; RequestConfig requestConfig = RequestConfig . custom ( ) . setConnectTimeout ( timeout ) . setConnectionRequestTimeout ( timeout ) . setSocketTimeout ( timeout ) . build ( ) ; getMethod . setConfig ( requestConfig ) ; HttpResponse response = httpClient . execute ( getMethod ) ; int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode != HttpResponseStatus . OK . code ( ) && statusCode != HttpResponseStatus . PARTIAL_CONTENT . code ( ) ) { String result = EntityUtils . toString ( response . getEntity ( ) ) ; throw new RuntimeException ( "return error !" + response . getStatusLine ( ) . getReasonPhrase ( ) + ", " + result ) ; } return response ;
public class Handler { /** * Generic method that would allow registration of any properly placed { @ code Handler } class . */ static void register ( Class < ? extends URLStreamHandler > handlerClass ) { } }
checkArgument ( "Handler" . equals ( handlerClass . getSimpleName ( ) ) ) ; String pkg = handlerClass . getPackage ( ) . getName ( ) ; int lastDot = pkg . lastIndexOf ( '.' ) ; checkArgument ( lastDot > 0 , "package for Handler (%s) must have a parent package" , pkg ) ; String parentPackage = pkg . substring ( 0 , lastDot ) ; String packages = System . getProperty ( JAVA_PROTOCOL_HANDLER_PACKAGES ) ; if ( packages == null ) { packages = parentPackage ; } else { packages += "|" + parentPackage ; } System . setProperty ( JAVA_PROTOCOL_HANDLER_PACKAGES , packages ) ;
public class PresentsDObjectMgr { /** * Sets up an access controller that will be provided to any distributed objects created on the * server . The controllers can subsequently be overridden if desired , but a default controller * is useful for implementing basic access control policies . */ public void setDefaultAccessController ( AccessController controller ) { } }
AccessController oldDefault = _defaultController ; _defaultController = controller ; // switch all objects from the old default ( null , usually ) to the new default . for ( DObject obj : _objects . values ( ) ) { if ( oldDefault == obj . getAccessController ( ) ) { obj . setAccessController ( controller ) ; } }
public class MassToFormulaTool { /** * Put the order the List of IIsotope according the probability occurrence . * @ param isotopes _ TO The List of IIsotope * @ return The list of IIsotope ordered */ private List < IIsotope > orderList ( List < IIsotope > isotopes_TO ) { } }
List < IIsotope > newOrderList = new ArrayList < IIsotope > ( ) ; for ( int i = 0 ; i < orderElements . length ; i ++ ) { String symbol = orderElements [ i ] ; Iterator < IIsotope > itIso = isotopes_TO . iterator ( ) ; while ( itIso . hasNext ( ) ) { IIsotope isotopeToCo = itIso . next ( ) ; if ( isotopeToCo . getSymbol ( ) . equals ( symbol ) ) { newOrderList . add ( isotopeToCo ) ; } } } return newOrderList ;
public class DummyInternalTransaction { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . InternalTransaction # optimisticReplace ( java . util . List , java . util . List , java . util . List , java . util . List , com . ibm . ws . objectManager . Transaction , * long ) */ protected synchronized void optimisticReplace ( java . util . List managedObjectsToAddReplace , java . util . List managedObjectsToReplace , java . util . List managedObjectsToDelete , java . util . List tokensToNotify , Transaction transaction , long logSpaceReservedDelta ) throws ObjectManagerException { } }
throw new InvalidStateException ( this , InternalTransaction . stateTerminated , InternalTransaction . stateNames [ InternalTransaction . stateTerminated ] ) ;
public class UDPChannel { /** * @ see * com . ibm . wsspi . channelfw . Channel # getConnectionLink ( com . ibm . wsspi . channelfw * . VirtualConnection ) */ public ConnectionLink getConnectionLink ( VirtualConnection vc ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "getConnectionLink" ) ; } UDPConnLink connLink = new UDPConnLink ( workQueueManager , vc , this , getConfig ( ) ) ; // add connection to inUse LinkedList synchronized ( inUse ) { inUse . add ( connLink ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "getConnectionLink: " + connLink ) ; } return connLink ;
public class Iterables { /** * Creates a iterator from given iterable . * @ param iterable the iterable * @ return a iterator */ @ SuppressWarnings ( "unchecked" ) public static Iterator < Object > iterator ( Object iterable ) { } }
Assert . state ( isIterable ( iterable . getClass ( ) ) ) ; return iterable . getClass ( ) . isArray ( ) ? new ArrayIterator ( iterable ) : ( ( Iterable < Object > ) iterable ) . iterator ( ) ;
public class ClassUtil { /** * Writes a class ' bytecode to an < code > OutputStream < / code > . * @ param cl The < code > Class < / code > to write . * @ param out The < code > OutputStream < / code > to write to . * @ throws IOException If unable to write to < code > out < / code > . */ public static void writeClassToStream ( Class < ? > cl , OutputStream out ) throws IOException { } }
InputStream in = getClassAsStream ( cl ) ; StreamUtil . writeStream ( in , out ) ; out . flush ( ) ;
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the cp attachment file entries before and after the current cp attachment file entry in the ordered set where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status = & # 63 ; . * @ param CPAttachmentFileEntryId the primary key of the current cp attachment file entry * @ param classNameId the class name ID * @ param classPK the class pk * @ param type the type * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the previous , current , and next cp attachment file entry * @ throws NoSuchCPAttachmentFileEntryException if a cp attachment file entry with the primary key could not be found */ @ Override public CPAttachmentFileEntry [ ] findByC_C_T_ST_PrevAndNext ( long CPAttachmentFileEntryId , long classNameId , long classPK , int type , int status , OrderByComparator < CPAttachmentFileEntry > orderByComparator ) throws NoSuchCPAttachmentFileEntryException { } }
CPAttachmentFileEntry cpAttachmentFileEntry = findByPrimaryKey ( CPAttachmentFileEntryId ) ; Session session = null ; try { session = openSession ( ) ; CPAttachmentFileEntry [ ] array = new CPAttachmentFileEntryImpl [ 3 ] ; array [ 0 ] = getByC_C_T_ST_PrevAndNext ( session , cpAttachmentFileEntry , classNameId , classPK , type , status , orderByComparator , true ) ; array [ 1 ] = cpAttachmentFileEntry ; array [ 2 ] = getByC_C_T_ST_PrevAndNext ( session , cpAttachmentFileEntry , classNameId , classPK , type , status , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
public class VecUtils { /** * Create a new { @ link Vec } of categorical values from an existing { @ link Vec } . * This method accepts all { @ link Vec } types as input . The original Vec is not mutated . * If src is a categorical { @ link Vec } , a copy is returned . * If src is a numeric { @ link Vec } , the values are converted to strings used as domain * values . * For all other types , an exception is currently thrown . These need to be replaced * with appropriate conversions . * Throws H2OIllegalArgumentException ( ) if the resulting domain exceeds * Categorical . MAX _ CATEGORICAL _ COUNT . * @ param src A { @ link Vec } whose values will be used as the basis for a new categorical { @ link Vec } * @ return the resulting categorical Vec */ public static Vec toCategoricalVec ( Vec src ) { } }
switch ( src . get_type ( ) ) { case Vec . T_CAT : return src . makeCopy ( src . domain ( ) ) ; case Vec . T_NUM : return numericToCategorical ( src ) ; case Vec . T_STR : // PUBDEV - 2204 return stringToCategorical ( src ) ; case Vec . T_TIME : // PUBDEV - 2205 throw new H2OIllegalArgumentException ( "Changing time/date columns to a categorical" + " column has not been implemented yet." ) ; case Vec . T_UUID : throw new H2OIllegalArgumentException ( "Changing UUID columns to a categorical" + " column has not been implemented yet." ) ; default : throw new H2OIllegalArgumentException ( "Unrecognized column type " + src . get_type_str ( ) + " given to toCategoricalVec()" ) ; }
public class RootResource { /** * ~ Methods * * * * * */ @ Override public List < Class < ? extends AbstractResource > > getEndpoints ( ) { } }
List < Class < ? extends AbstractResource > > result = new LinkedList < > ( ) ; result . add ( AuditResources . class ) ; result . add ( AuthResources . class ) ; result . add ( AuthResourcesV2 . class ) ; result . add ( AlertResources . class ) ; result . add ( AnnotationResources . class ) ; result . add ( CollectionResources . class ) ; result . add ( DashboardResources . class ) ; result . add ( HistoryResources . class ) ; result . add ( ManagementResources . class ) ; result . add ( MetricResources . class ) ; result . add ( NamespaceResources . class ) ; result . add ( UserResources . class ) ; result . add ( DiscoveryResources . class ) ; return result ;
public class EntityClass { /** * Factory method . * @ param clazz * the class to wrap * @ param scanOption * whether consider optional OneToOne as required * @ return a wrapper for the entity class */ public static EntityClass from ( final Class clazz , final ScanOption scanOption ) { } }
try { return CACHE . get ( CacheKey . of ( clazz , scanOption ) , new Callable < EntityClass > ( ) { @ Override public EntityClass call ( ) throws Exception { return createEntityClass ( clazz , scanOption ) ; } } ) ; } catch ( ExecutionException e ) { throw Throwables . propagate ( e ) ; }
public class AuthorizedList { /** * Adds a compartment that the user should be allowed to access * @ param theCompartment The compartment name , e . g . " Patient / 123 " ( in this example the user would be allowed to access Patient / 123 as well as Observations where Observation . subject = " Patient / 123 " m , etc . * @ return Returns < code > this < / code > for easy method chaining */ public AuthorizedList addCompartment ( String theCompartment ) { } }
Validate . notNull ( theCompartment , "theCompartment must not be null" ) ; if ( myAllowedCompartments == null ) { myAllowedCompartments = new ArrayList < > ( ) ; } myAllowedCompartments . add ( theCompartment ) ; return this ;
public class Pool { public void dump ( String msg ) { } }
StringBuffer pond = new StringBuffer ( ) ; StringBuffer avail = new StringBuffer ( ) ; StringBuffer index = new StringBuffer ( ) ; pond . append ( "pond: " ) ; avail . append ( "avail:" ) ; index . append ( "index:" ) ; for ( int i = 0 ; i < _pondLife . length ; i ++ ) { if ( _pondLife [ i ] == null ) pond . append ( " " ) ; else { pond . append ( ' ' ) ; StringUtil . append ( pond , ( byte ) i , 16 ) ; } if ( i == _size ) avail . append ( i == _available ? " AS" : " S" ) ; else avail . append ( i == _available ? " A " : " " ) ; index . append ( ' ' ) ; StringUtil . append ( index , ( byte ) _index [ i ] , 16 ) ; } System . err . println ( ) ; System . err . println ( msg ) ; System . err . println ( pond ) ; System . err . println ( avail ) ; System . err . println ( index ) ;
public class CmsGalleryController { /** * Looks for an ancestor tree entry for the given path . < p > * @ param possibleParent the possible parent entry * @ param targetPath the target path * @ return the parent entry or < code > null < / code > if there is none */ private CmsGalleryTreeEntry lookForParent ( CmsGalleryTreeEntry possibleParent , String targetPath ) { } }
if ( targetPath . startsWith ( possibleParent . getPath ( ) ) ) { return possibleParent ; } if ( possibleParent . getParent ( ) != null ) { return lookForParent ( possibleParent . getParent ( ) , targetPath ) ; } return null ;
public class Link { /** * This version returns the next physical link ( which may be logically * unlinked ) * @ return the next link object or null if nothing left in the list to return */ public final Link getNextPhysicalLink ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getNextPhysicalLink" , _positionString ( ) ) ; } Link nextLink = _nextLink ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( this , tc , "getNextPhysicalLink" , nextLink ) ; } return nextLink ;
public class LObjDblPredicateBuilder { /** * 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 < T > LObjDblPredicate < T > objDblPredicateFrom ( Consumer < LObjDblPredicateBuilder < T > > buildingFunction ) { } }
LObjDblPredicateBuilder builder = new LObjDblPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class QueryBuilder { /** * Like { @ link # join ( QueryBuilder ) } but this combines the WHERE statements of two query builders with a SQL " OR " . */ public QueryBuilder < T , ID > joinOr ( QueryBuilder < ? , ? > joinedQueryBuilder ) throws SQLException { } }
addJoinInfo ( JoinType . INNER , null , null , joinedQueryBuilder , JoinWhereOperation . OR ) ; return this ;
public class Cpe { /** * This does not follow the spec precisely because ANY compared to NA is * classified as undefined by the spec ; however , in this implementation ANY * will match NA and return true . * This will compare the left value to the right value and return true if * the left matches the right . Note that it is possible that the right would * not match the left value . * @ param left the left value to compare * @ param right the right value to compare * @ return < code > true < / code > if the left value matches the right value ; * otherwise < code > false < / code > */ protected static boolean compareAttributes ( Part left , Part right ) { } }
if ( left == right ) { return true ; } else if ( left == Part . ANY ) { return true ; } return false ;
public class ExecutorCommand { /** * Invokes runnable asynchronously with respecting circuit logic and cache * logic if configured . If callable completed with success then the * { @ code onSuccess } method is called . If callable throws exception then * { @ code onFailure } method is called * @ param < V > type of returned value by callable * @ param callable method fired by executor * @ param onSuccess method fired if callable is completed with success * @ param onFailure method fired if callable throws */ public < V > void observe ( Callable < V > callable , CheckedConsumer < V > onSuccess , Consumer < Exception > onFailure ) { } }
service . executeAsynchronously ( wrap ( callable , onSuccess , onFailure ) , config ) ;
public class ViewDragHelper { /** * Check if this event as provided to the parent view ' s * onInterceptTouchEvent should cause the parent to intercept the touch * event stream . * @ param ev MotionEvent provided to onInterceptTouchEvent * @ return true if the parent view should return true from * onInterceptTouchEvent */ public boolean shouldInterceptTouchEvent ( MotionEvent ev ) { } }
final int action = MotionEventCompat . getActionMasked ( ev ) ; final int actionIndex = MotionEventCompat . getActionIndex ( ev ) ; if ( action == MotionEvent . ACTION_DOWN ) { // Reset things for a new event stream , just in case we didn ' t get // the whole previous stream . cancel ( ) ; } if ( mVelocityTracker == null ) { mVelocityTracker = VelocityTracker . obtain ( ) ; } mVelocityTracker . addMovement ( ev ) ; switch ( action ) { case MotionEvent . ACTION_DOWN : { final float x = ev . getX ( ) ; final float y = ev . getY ( ) ; final int pointerId = MotionEventCompat . getPointerId ( ev , 0 ) ; saveInitialMotion ( x , y , pointerId ) ; final View toCapture = findTopChildUnder ( ( int ) x , ( int ) y ) ; // Catch a settling view if possible . if ( toCapture == mCapturedView && mDragState == STATE_SETTLING ) { tryCaptureViewForDrag ( toCapture , pointerId ) ; } final int edgesTouched = mInitialEdgeTouched [ pointerId ] ; if ( ( edgesTouched & mTrackingEdges ) != 0 ) { mCallback . onEdgeTouched ( edgesTouched & mTrackingEdges , pointerId ) ; } break ; } case MotionEventCompat . ACTION_POINTER_DOWN : { final int pointerId = MotionEventCompat . getPointerId ( ev , actionIndex ) ; final float x = MotionEventCompat . getX ( ev , actionIndex ) ; final float y = MotionEventCompat . getY ( ev , actionIndex ) ; saveInitialMotion ( x , y , pointerId ) ; // A ViewDragHelper can only manipulate one view at a time . if ( mDragState == STATE_IDLE ) { final int edgesTouched = mInitialEdgeTouched [ pointerId ] ; if ( ( edgesTouched & mTrackingEdges ) != 0 ) { mCallback . onEdgeTouched ( edgesTouched & mTrackingEdges , pointerId ) ; } } else if ( mDragState == STATE_SETTLING ) { // Catch a settling view if possible . final View toCapture = findTopChildUnder ( ( int ) x , ( int ) y ) ; if ( toCapture == mCapturedView ) { tryCaptureViewForDrag ( toCapture , pointerId ) ; } } break ; } case MotionEvent . ACTION_MOVE : { // First to cross a touch slop over a draggable view wins . Also // report edge drags . final int pointerCount = MotionEventCompat . getPointerCount ( ev ) ; for ( int i = 0 ; i < pointerCount ; i ++ ) { final int pointerId = MotionEventCompat . getPointerId ( ev , i ) ; final float x = MotionEventCompat . getX ( ev , i ) ; final float y = MotionEventCompat . getY ( ev , i ) ; final float dx = x - mInitialMotionX [ pointerId ] ; final float dy = y - mInitialMotionY [ pointerId ] ; reportNewEdgeDrags ( dx , dy , pointerId ) ; if ( mDragState == STATE_DRAGGING ) { // Callback might have started an edge drag break ; } final View toCapture = findTopChildUnder ( ( int ) x , ( int ) y ) ; if ( toCapture != null && checkTouchSlop ( toCapture , dx , dy ) && tryCaptureViewForDrag ( toCapture , pointerId ) ) { break ; } } saveLastMotion ( ev ) ; break ; } case MotionEventCompat . ACTION_POINTER_UP : { final int pointerId = MotionEventCompat . getPointerId ( ev , actionIndex ) ; clearMotionHistory ( pointerId ) ; break ; } case MotionEvent . ACTION_UP : case MotionEvent . ACTION_CANCEL : { cancel ( ) ; break ; } } return mDragState == STATE_DRAGGING ;
public class DeliveryDelayManager { /** * Remove the DeliveryDelayable reference from the DeliveryDelay index . This will remove the * current entry pointed - to by the iterator . * @ param deliveryDelayableReference our reference to the DeliveryDelayable * @ param unlocked true if the item is being removed after delivery delay time , false if being * removed because it is no longer in store . Used for diagnostics only . * @ return true if the object was successfully removed from the index . */ private final boolean remove ( DeliveryDelayableReference deliveryDelayableReference , boolean unlocked ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" , " deliveryDelayableReference=" + deliveryDelayableReference + " unlocked=" + unlocked + " deliveryDelayIndex=" + deliveryDelayIndex . size ( ) ) ; boolean reply = false ; // synchronize on the lockObject synchronized ( lockObject ) { reply = deliveryDelayIndex . remove ( ) ; } if ( reply ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Removed (" + ( unlocked ? "unlocked" : "gone" ) + ")" + " DDT=" + deliveryDelayableReference . getDeliveryDelayTime ( ) + " objId=" + deliveryDelayableReference . getID ( ) + " DeliveryDelayIndexSize=" + deliveryDelayIndex . size ( ) ) ; } else { // can happen if the element is already deleted if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Did not remove from index: " + " DDT=" + deliveryDelayableReference . getDeliveryDelayTime ( ) + " objId=" + deliveryDelayableReference . getID ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "remove" , "deliveryDelayIndex=" + deliveryDelayIndex . size ( ) + " reply=" + reply ) ; return reply ;
public class MessageBuilder { /** * Creates a JOIN message . * @ return a protobuf message . */ public static Message buildJoin ( Zxid lastZxid ) { } }
ZabMessage . Zxid zxid = toProtoZxid ( lastZxid ) ; ZabMessage . Join join = ZabMessage . Join . newBuilder ( ) . setLastZxid ( zxid ) . build ( ) ; return Message . newBuilder ( ) . setType ( MessageType . JOIN ) . setJoin ( join ) . build ( ) ;
public class Iconics { /** * Test if the icon exists in the currently loaded fonts * @ param context A context to access application resources * @ param icon The icon to verify * @ return true if the icon is available */ public static boolean iconExists ( @ NonNull Context context , @ NonNull String icon ) { } }
try { ITypeface font = findFont ( context , icon . substring ( 0 , 3 ) ) ; icon = icon . replace ( "-" , "_" ) ; font . getIcon ( icon ) ; return true ; } catch ( Exception ignore ) { return false ; }
public class MalisisRegistry { /** * Registers a { @ link IRenderWorldLast } . * @ param renderer the renderer */ @ SideOnly ( Side . CLIENT ) public static void registerRenderWorldLast ( IRenderWorldLast renderer ) { } }
clientRegistry . renderWorldLastRenderers . add ( renderer ) ;
public class ChainReducer { /** * Chains the < code > reduce ( . . . ) < / code > method of the Reducer with the * < code > map ( . . . ) < / code > methods of the Mappers in the chain . */ @ SuppressWarnings ( { } }
"unchecked" } ) public void reduce ( Object key , Iterator values , OutputCollector output , Reporter reporter ) throws IOException { Reducer reducer = chain . getReducer ( ) ; if ( reducer != null ) { reducer . reduce ( key , values , chain . getReducerCollector ( output , reporter ) , reporter ) ; }
public class NumberBindings { /** * A boolean binding that is ` true ` if the given observable double is * * Infinite * * . * See { @ link Double # isInfinite ( double ) } . * @ param observableValue the observable double value to use for the binding . * @ return the boolean binding . */ public static BooleanBinding isInfinite ( final ObservableDoubleValue observableValue ) { } }
return Bindings . createBooleanBinding ( ( ) -> Double . isInfinite ( observableValue . get ( ) ) , observableValue ) ;
public class TargetController { /** * Creates a Deployer { @ link Target } . * @ param params the body of the request with the template parameters that will be used to create the target . The body must * contain at least a { @ code env } and { @ code site _ name } parameter . Other required parameters depend on the * template used . * @ return the response entity 201 CREATED status * @ throws DeployerException if an error ocurred during target creation * @ throws ValidationException if a required parameter is missing */ @ RequestMapping ( value = CREATE_TARGET_URL , method = RequestMethod . POST ) public ResponseEntity < Result > createTarget ( @ RequestBody Map < String , Object > params ) throws DeployerException , ValidationException { } }
String env = "" ; String siteName = "" ; boolean replace = false ; String templateName = "" ; Map < String , Object > templateParams = new HashMap < > ( ) ; for ( Map . Entry < String , Object > param : params . entrySet ( ) ) { switch ( param . getKey ( ) ) { case ENV_PATH_VAR_NAME : env = Objects . toString ( param . getValue ( ) , "" ) ; break ; case SITE_NAME_PATH_VAR_NAME : siteName = Objects . toString ( param . getValue ( ) , "" ) ; break ; case REPLACE_PARAM_NAME : replace = BooleanUtils . toBoolean ( param . getValue ( ) ) ; break ; case TEMPLATE_NAME_PARAM_NAME : templateName = Objects . toString ( param . getValue ( ) , "" ) ; break ; default : templateParams . put ( param . getKey ( ) , param . getValue ( ) ) ; break ; } } ValidationResult validationResult = new ValidationResult ( ) ; if ( StringUtils . isEmpty ( env ) ) { validationResult . addError ( ENV_PATH_VAR_NAME , ErrorCodes . FIELD_MISSING_ERROR_CODE ) ; } if ( StringUtils . isEmpty ( siteName ) ) { validationResult . addError ( SITE_NAME_PATH_VAR_NAME , ErrorCodes . FIELD_MISSING_ERROR_CODE ) ; } if ( validationResult . hasErrors ( ) ) { throw new ValidationException ( validationResult ) ; } targetService . createTarget ( env , siteName , replace , templateName , templateParams ) ; return new ResponseEntity < > ( Result . OK , RestServiceUtils . setLocationHeader ( new HttpHeaders ( ) , BASE_URL + GET_TARGET_URL , env , siteName ) , HttpStatus . CREATED ) ;
public class DeltaFIFO { /** * Add Sync delta . Caller must hold the lock . */ private void syncKeyLocked ( String key ) { } }
ApiType obj = this . knownObjects . getByKey ( key ) ; if ( obj == null ) { return ; } String id = this . keyOf ( obj ) ; Deque < MutablePair < DeltaType , Object > > deltas = this . items . get ( id ) ; if ( deltas != null && ! ( Collections . isEmptyCollection ( deltas ) ) ) { return ; } this . queueActionLocked ( DeltaType . Sync , obj ) ;
public class CSSFactory { /** * Returns the registered DeclarationTransformer * @ return DeclarationTransformer instance */ public static final DeclarationTransformer getDeclarationTransformer ( ) { } }
if ( dt == null ) { try { @ SuppressWarnings ( "unchecked" ) Class < ? extends DeclarationTransformerImpl > clazz = ( Class < ? extends DeclarationTransformerImpl > ) Class . forName ( DEFAULT_DECLARATION_TRANSFORMER ) ; Method m = clazz . getMethod ( "getInstance" ) ; registerDeclarationTransformer ( ( DeclarationTransformerImpl ) m . invoke ( null ) ) ; log . debug ( "Retrived {} as default DeclarationTransformer implementation." , DEFAULT_DECLARATION_TRANSFORMER ) ; } catch ( Exception e ) { log . error ( "Unable to get DeclarationTransformer from default" , e ) ; throw new RuntimeException ( "No DeclarationTransformer implementation registered!" ) ; } } return dt ;
public class CudaGridExecutioner { /** * This method checks , if opA and opB are sharing the same operands * @ param opA * @ param opB * @ return */ protected boolean isMatchingZX ( Op opA , Op opB ) { } }
if ( opA . x ( ) == opB . x ( ) && opA . z ( ) == opB . z ( ) && opA . x ( ) == opB . z ( ) ) return true ; return false ;
public class ModelsImpl { /** * Gets information about the application version ' s Pattern . Any model . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity extractor ID . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < PatternAnyEntityExtractor > getPatternAnyEntityInfoAsync ( UUID appId , String versionId , UUID entityId , final ServiceCallback < PatternAnyEntityExtractor > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getPatternAnyEntityInfoWithServiceResponseAsync ( appId , versionId , entityId ) , serviceCallback ) ;
public class CharacterSet { /** * Creates a new CharacterSet . If there is already a CharacterSet with the given ID this will be * returned . */ public static CharacterSet createCharacterSet ( final String encoding , final String goodExpression , final String badExpression , final String characterSetId ) throws UnsupportedEncodingException { } }
if ( characterSets . get ( ) . containsKey ( characterSetId ) ) { LOG . info ( "CharacterSet with id=" + characterSetId + " already created" ) ; return characterSets . get ( ) . get ( characterSetId ) ; } CharacterSet cs = new CharacterSet ( encoding , goodExpression , badExpression , characterSetId ) ; characterSets . get ( ) . put ( characterSetId , cs ) ; LOG . info ( "Added " + cs ) ; return cs ;
public class ODataEntityProvider { /** * ( non - Javadoc ) * @ see javax . ws . rs . ext . MessageBodyReader # isReadable ( java . lang . Class , * java . lang . reflect . Type , java . lang . annotation . Annotation [ ] , * javax . ws . rs . core . MediaType ) */ @ Override public boolean isReadable ( Class < ? > type , Type genericType , Annotation [ ] annotations , MediaType mediaType ) { } }
return ODataEntity . isODataEntityType ( type ) ;
public class SipParser { /** * Consume linear whitespace ( LWS ) , which according to RFC3261 section 25.1 * Basic Rules is : * LWS = [ * WSP CRLF ] 1 * WSP ; linear whitespace * @ param buffer * @ return the number of bytes consumed */ public static int consumeLWS ( final Buffer buffer ) throws SipParseException { } }
final int i = buffer . getReaderIndex ( ) ; consumeWS ( buffer ) ; // if we consume a CRLF we expect at least ONE WS to be present next if ( consumeCRLF ( buffer ) > 0 ) { expectWS ( buffer ) ; } consumeWS ( buffer ) ; if ( buffer . getReaderIndex ( ) == i ) { throw new SipParseException ( i , "Expected at least 1 WSP" ) ; } return buffer . getReaderIndex ( ) - i ;
public class XmlUtilities { /** * Convert the current record to an XML String . * Careful , as this method just returns the XML fragment ( with header or a top - level tag ) . * @ param The record to convert . * @ return The XML representation of this record . */ public static String createXMLStringRecord ( Record record ) { } }
String string = DBConstants . BLANK ; DocumentBuilder db = Utility . getDocumentBuilder ( ) ; DocumentBuilder stringdb = Utility . getDocumentBuilder ( ) ; Document doc = null ; synchronized ( db ) { doc = db . newDocument ( ) ; Element elRoot = ( Element ) doc . createElement ( ROOT_TAG ) ; doc . appendChild ( elRoot ) ; try { XmlInOut . enableAllBehaviors ( record , false , true ) ; // Disable file behaviors createXMLRecord ( stringdb , record , doc , elRoot ) ; elRoot . appendChild ( doc . createTextNode ( XmlUtilities . NEWLINE ) ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; return DBConstants . BLANK ; } } try { StringWriter out = new StringWriter ( ) ; // , MIME2Java . convert ( " UTF - 8 " ) ) ; // Use a Transformer for output TransformerFactory tFactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tFactory . newTransformer ( ) ; DOMSource source = new DOMSource ( doc ) ; StreamResult result = new StreamResult ( out ) ; transformer . transform ( source , result ) ; out . close ( ) ; string = out . toString ( ) ; int iStartString = string . indexOf ( "<" + ROOT_TAG + ">" ) + 3 + ROOT_TAG . length ( ) ; int iEndString = string . indexOf ( "</" + ROOT_TAG + ">" ) ; if ( iStartString >= iEndString ) string = DBConstants . BLANK ; else string = string . substring ( iStartString , iEndString ) ; } catch ( TransformerConfigurationException tce ) { // Error generated by the parser tce . printStackTrace ( ) ; } catch ( TransformerException te ) { // Error generated by the parser te . printStackTrace ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } XmlInOut . enableAllBehaviors ( record , true , true ) ; return string ;
public class AddValue { /** * Creates the setValue method . */ private MethodSpec makeSetValue ( ) { } }
MethodSpec . Builder setter = MethodSpec . methodBuilder ( "setValue" ) . addModifiers ( context . publicFinalModifiers ( ) ) . addParameter ( vTypeVar , "value" ) . addParameter ( vRefQueueType , "referenceQueue" ) ; if ( isStrongValues ( ) ) { setter . addStatement ( "$T.UNSAFE.putObject(this, $N, $N)" , UNSAFE_ACCESS , offsetName ( "value" ) , "value" ) ; } else { setter . addStatement ( "(($T<V>) getValueReference()).clear()" , Reference . class ) ; setter . addStatement ( "$T.UNSAFE.putObject(this, $N, new $T($L, $N, referenceQueue))" , UNSAFE_ACCESS , offsetName ( "value" ) , valueReferenceType ( ) , "getKeyReference()" , "value" ) ; } return setter . build ( ) ;
public class OrdersInner { /** * Creates or updates an order . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param order The order to be created or updated . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the OrderInner object if successful . */ public OrderInner beginCreateOrUpdate ( String deviceName , String resourceGroupName , OrderInner order ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( deviceName , resourceGroupName , order ) . toBlocking ( ) . single ( ) . body ( ) ;
public class MailUtil { /** * Delivers the supplied mail message using the machine ' s local mail * SMTP server which must be listening on port 25 . If the * < code > mail . smtp . host < / code > system property is set , that will be * used instead of localhost . * @ exception IOException thrown if an error occurs delivering the * email . See { @ link Transport # send } for exceptions that can be thrown * due to response from the SMTP server . */ public static void deliverMail ( String [ ] recipients , String sender , String subject , String body ) throws IOException { } }
deliverMail ( recipients , sender , subject , body , null , null ) ;
public class AbstractEvaluationTask { /** * Performs the evaluation . */ public Boolean call ( ) throws Exception { } }
Boolean result ; try { result = doRun ( ) ; } catch ( Exception e ) { m_Exception = e ; throw e ; } finally { cleanUp ( ) ; } return result ;
public class DynamoDbServiceRegistryFacilitator { /** * Get registered service . * @ param id the id * @ return the registered service */ public RegisteredService get ( final long id ) { } }
val keys = new HashMap < String , AttributeValue > ( ) ; keys . put ( ColumnNames . ID . getColumnName ( ) , new AttributeValue ( String . valueOf ( id ) ) ) ; return getRegisteredServiceByKeys ( keys ) ;
public class DebugStructureInterceptor { /** * Override paint to render additional information for debugging purposes . * @ param renderContext the renderContext to send the output to . */ @ Override public void paint ( final RenderContext renderContext ) { } }
super . paint ( renderContext ) ; if ( ! DebugUtil . isDebugFeaturesEnabled ( ) || ! ( renderContext instanceof WebXmlRenderContext ) ) { return ; } XmlStringBuilder xml = ( ( WebXmlRenderContext ) renderContext ) . getWriter ( ) ; xml . appendTag ( "ui:debug" ) ; writeDebugInfo ( getUI ( ) , xml ) ; xml . appendEndTag ( "ui:debug" ) ;
public class CmsListDirectAction { /** * Help method to resolve the help text to use . < p > * @ param locale the used locale * @ return the help text */ protected String resolveHelpText ( Locale locale ) { } }
String helpText = getHelpText ( ) . key ( locale ) ; if ( ( getColumnForTexts ( ) != null ) && ( getItem ( ) . get ( getColumnForTexts ( ) ) != null ) ) { helpText = new MessageFormat ( helpText , locale ) . format ( new Object [ ] { getItem ( ) . get ( getColumnForTexts ( ) ) } ) ; } return helpText ;
public class GetContactAttributesResult { /** * The attributes to update . * @ param attributes * The attributes to update . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetContactAttributesResult withAttributes ( java . util . Map < String , String > attributes ) { } }
setAttributes ( attributes ) ; return this ;
public class Engine { private Content doRequest ( String path ) throws IOException { } }
Content result ; result = doRequestNoStats ( path ) ; requestedBytes . addAndGet ( result . bytes . length ) ; return result ;
public class DomainService { /** * Delete a connector . * @ param id the id of the entity to delete . */ public void deleteConnector ( Long chargingStationTypeId , Long evseId , Long id ) { } }
ChargingStationType chargingStationType = chargingStationTypeRepository . findOne ( chargingStationTypeId ) ; Evse evse = getEvseById ( chargingStationType , evseId ) ; Connector connector = getConnectorById ( evse , id ) ; evse . getConnectors ( ) . remove ( connector ) ; chargingStationTypeRepository . createOrUpdate ( chargingStationType ) ;
public class NodeAvailabilityCache { /** * A set of nodes that are stored as unavailable . * @ return a set of unavailable nodes , never < code > null < / code > . */ public Set < K > getUnavailableNodes ( ) { } }
final Set < K > result = new HashSet < K > ( ) ; for ( final Map . Entry < K , ManagedItem < Boolean > > entry : _map . entrySet ( ) ) { if ( ! entry . getValue ( ) . _value . booleanValue ( ) && ! isExpired ( entry . getValue ( ) ) ) { result . add ( entry . getKey ( ) ) ; } } return result ;
public class HttpServerExchange { /** * Sets the max entity size for this exchange . This cannot be modified after the request channel has been obtained . * @ param maxEntitySize The max entity size */ public HttpServerExchange setMaxEntitySize ( final long maxEntitySize ) { } }
if ( ! isRequestChannelAvailable ( ) ) { throw UndertowMessages . MESSAGES . requestChannelAlreadyProvided ( ) ; } this . maxEntitySize = maxEntitySize ; connection . maxEntitySizeUpdated ( this ) ; return this ;
public class ExitHandler { /** * ( non - Javadoc ) * @ see org . restcomm . ss7 . management . console . CommandHandler # isAvailable ( org . mobicents * . ss7 . management . console . CommandContext ) */ @ Override public boolean isAvailable ( CommandContext commandContext ) { } }
// Available only in disconnected mode if ( commandContext . isControllerConnected ( ) ) { commandContext . printLine ( "The command is not available in the current context. Please disconnnect first" ) ; return false ; } return true ;