signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class QueryCommentCloner { /** * Clones comments */ public void cloneComments ( ) { } }
QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO ( ) ; while ( ! queue . isEmpty ( ) ) { QueryQuestionComment queryComment = queue . remove ( 0 ) ; QueryQuestionComment originalParentComment = queryComment . getParentComment ( ) ; QueryReply newReply = replyMap . get ( queryComment . getQue...
public class AnnotationTypeOptionalMemberWriterImpl { /** * { @ inheritDoc } */ public void addDefaultValueInfo ( Element member , Content annotationDocTree ) { } }
if ( utils . isAnnotationType ( member ) ) { ExecutableElement ee = ( ExecutableElement ) member ; AnnotationValue value = ee . getDefaultValue ( ) ; if ( value != null ) { Content dt = HtmlTree . DT ( contents . default_ ) ; Content dl = HtmlTree . DL ( dt ) ; Content dd = HtmlTree . DD ( new StringContent ( value . t...
public class ListSimulationApplicationsResult { /** * A list of simulation application summaries that meet the criteria of the request . * @ param simulationApplicationSummaries * A list of simulation application summaries that meet the criteria of the request . */ public void setSimulationApplicationSummaries ( ja...
if ( simulationApplicationSummaries == null ) { this . simulationApplicationSummaries = null ; return ; } this . simulationApplicationSummaries = new java . util . ArrayList < SimulationApplicationSummary > ( simulationApplicationSummaries ) ;
public class JKTableRecord { public Float getColumnValueAsFloat ( final int col ) { } }
final Object value = getColumnValue ( col ) ; if ( value == null ) { return null ; } return new Float ( value . toString ( ) ) ;
public class AbstractDocumentQuery { /** * Matches fields where the value is between the specified start and end , inclusive * @ param fieldName Field name to use * @ param start Range start * @ param end Range end * @ param exact Use exact matcher */ @ Override public void _whereBetween ( String fieldName , Ob...
fieldName = ensureValidFieldName ( fieldName , false ) ; List < QueryToken > tokens = getCurrentWhereTokens ( ) ; appendOperatorIfNeeded ( tokens ) ; negateIfNeeded ( tokens , fieldName ) ; WhereParams startParams = new WhereParams ( ) ; startParams . setValue ( start ) ; startParams . setFieldName ( fieldName ) ; Wher...
public class DescribeEventTypesResult { /** * A list of event types that match the filter criteria . Event types have a category ( < code > issue < / code > , * < code > accountNotification < / code > , or < code > scheduledChange < / code > ) , a service ( for example , < code > EC2 < / code > , * < code > RDS < /...
if ( this . eventTypes == null ) { setEventTypes ( new java . util . ArrayList < EventType > ( eventTypes . length ) ) ; } for ( EventType ele : eventTypes ) { this . eventTypes . add ( ele ) ; } return this ;
public class RotateEncrypt { /** * This function takes a plain text as input and returns the encrypted * text by rotating the alphabets by two places twice . * That is , ' a ' turns into ' e ' , ' b ' turns into ' f ' , and so on . * @ param text A plain string text to be encrypted . * @ return A string where e...
int rotationFactor = 4 ; // 2 places twice String lowerAlphabet = "abcdefghijklmnopqrstuvwxyz" ; String encryptedText = "" ; for ( char charElement : text . toCharArray ( ) ) { if ( lowerAlphabet . indexOf ( charElement ) != - 1 ) { int newIndex = ( lowerAlphabet . indexOf ( charElement ) + rotationFactor ) % lowerAlph...
public class Snappy { /** * Returns true iff the contents of compressed buffer [ pos ( ) . . . limit ( ) ) * can be uncompressed successfully . Does not return the uncompressed data . * Takes time proportional to the input length , but is usually at least a * factor of four faster than actual decompression . */ p...
return impl . isValidCompressedBuffer ( compressed , compressed . position ( ) , compressed . remaining ( ) ) ;
public class CmsObjectWrapper { /** * Returns a link to a resource after it was wrapped by the CmsObjectWrapper . < p > * Because it is possible to change the names of resources inside the VFS by this * < code > CmsObjectWrapper < / code > , it is necessary to change the links used in pages * as well , so that th...
CmsResource res = null ; try { res = readResource ( m_cms . getRequestContext ( ) . removeSiteRoot ( path ) , CmsResourceFilter . ALL ) ; if ( res != null ) { String ret = null ; // iterate through all wrappers and call " rewriteLink " till one does not return null List < I_CmsResourceWrapper > wrappers = getWrappers (...
public class CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl { /** * Sets the resource local service . * @ param resourceLocalService the resource local service */ public void setResourceLocalService ( com . liferay . portal . kernel . service . ResourceLocalService resourceLocalService ) { } }
this . resourceLocalService = resourceLocalService ;
public class CSSMediaRule { /** * Add a new media query . * @ param aMediaQuery * The media query to be added . May not be < code > null < / code > . * @ return this for chaining */ @ Nonnull public CSSMediaRule addMediaQuery ( @ Nonnull @ Nonempty final CSSMediaQuery aMediaQuery ) { } }
ValueEnforcer . notNull ( aMediaQuery , "MediaQuery" ) ; m_aMediaQueries . add ( aMediaQuery ) ; return this ;
public class Neighbours { /** * Finds a Bus given its name . * @ param name The name of the Bus to find * @ return The BusGroup or null if not found . */ private BusGroup findBus ( String name ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "findBus" , name ) ; // Cycle through the list of Buss . for ( int i = 0 ; i < _buses . length ; ++ i ) // Check if the Bus name is the one we are looking for if ( _buses [ i ] . getName ( ) . equals ( name ) ) { if ( TraceC...
public class StunAttributeFactory { /** * Creates a ResponseFromAddressAttribute of the specified type and with the * specified address and port * @ param address * the address value of the address attribute * @ return the newly created address attribute . */ public static ResponseAddressAttribute createRespons...
ResponseAddressAttribute attribute = new ResponseAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ;
public class GeometryServiceImpl { /** * Parse the given Well Known Text string into a geometry . * @ param wkt * The WKT text . * @ return The resulting geometry , or null in case something went wrong . */ public Geometry toGeometry ( String wkt ) { } }
try { return WktService . toGeometry ( wkt ) ; } catch ( WktException e ) { return null ; }
public class Case { /** * 连词符命名风格字符串 * @ param str * 待转换字符串 * @ return 连词符命名风格字符串 * @ author Zhanghongdong */ public static String toHyphenLine ( String str ) { } }
if ( str == null ) { return null ; } if ( str . isEmpty ( ) ) { return str ; } // 本身连词符 if ( str . indexOf ( SEPARATOR_HYPHEN_LINE ) >= 0 ) { return str . toLowerCase ( ) ; } // 本身下划线 if ( str . indexOf ( SEPARATOR_UNDER_LINE ) >= 0 ) { return str . replace ( SEPARATOR_UNDER_LINE , SEPARATOR_HYPHEN_LINE ) . toLowerCase...
public class AgentMonitoring { /** * This method lists the available handlers and logs them . */ public static void listHandlers ( List < IMonitoringHandler > handlers , Logger logger ) { } }
if ( handlers . isEmpty ( ) ) { logger . info ( "No monitoring handler was found." ) ; } else { StringBuilder sb = new StringBuilder ( "Available monitoring handlers: " ) ; for ( Iterator < IMonitoringHandler > it = handlers . iterator ( ) ; it . hasNext ( ) ; ) { sb . append ( it . next ( ) . getName ( ) ) ; if ( it ....
public class ApiUtils { /** * Gets an optional enum param , returning { @ code null } if the parameter was not found . * @ param < E > the type of the enum that will be returned * @ param params the params * @ param paramName the param name * @ param enumType the type of the enum * @ return the enum , or { @ ...
String enumValS = params . optString ( paramName , null ) ; E enumVal = null ; if ( enumValS != null && ! enumValS . isEmpty ( ) ) { try { enumVal = Enum . valueOf ( enumType , enumValS ) ; } catch ( Exception ex ) { throw new ApiException ( ApiException . Type . ILLEGAL_PARAMETER , paramName + ": " + ex . getLocalized...
public class Pickler { /** * Get the custom pickler fot the given class , to be able to pickle not just built in collection types . * A custom pickler is matched on the interface or abstract base class that the object implements or inherits from . * @ param t the class of the object to be pickled * @ return null ...
IObjectPickler pickler = customPicklers . get ( t ) ; if ( pickler != null ) { return pickler ; // exact match } // check if there ' s a custom pickler registered for an interface or abstract base class // that this object implements or inherits from . for ( Entry < Class < ? > , IObjectPickler > x : customPicklers . e...
public class ContextRefresher { /** * source names */ private StandardEnvironment copyEnvironment ( ConfigurableEnvironment input ) { } }
StandardEnvironment environment = new StandardEnvironment ( ) ; MutablePropertySources capturedPropertySources = environment . getPropertySources ( ) ; // Only copy the default property source ( s ) and the profiles over from the main // environment ( everything else should be pristine , just like it was on startup ) ....
public class DateHelper { /** * Returns the earlier of two dates , handling null values . A non - null Date * is always considered to be earlier than a null Date . * @ param d1 Date instance * @ param d2 Date instance * @ return Date earliest date */ public static Date min ( Date d1 , Date d2 ) { } }
Date result ; if ( d1 == null ) { result = d2 ; } else if ( d2 == null ) { result = d1 ; } else { result = ( d1 . compareTo ( d2 ) < 0 ) ? d1 : d2 ; } return result ;
public class CmsDriverManager { /** * Deletes all relations for the given resource matching the given filter . < p > * @ param dbc the current db context * @ param resource the resource to delete the relations for * @ param filter the filter to use for deletion * @ throws CmsException if something goes wrong ...
if ( filter . includesDefinedInContent ( ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_DELETE_RELATION_IN_CONTENT_2 , dbc . removeSiteRoot ( resource . getRootPath ( ) ) , filter . getTypes ( ) ) ) ; } getVfsDriver ( dbc ) . deleteRelations ( dbc , dbc . currentProject ( ...
public class GenericsResolutionUtils { /** * Inner class could reference outer class generics and so this generics must be included into class context . * Outer generics could be included into declaration like { @ code Outer < String > . Inner field } . In this case * incoming type should be { @ link ParameterizedT...
final LinkedHashMap < String , Type > res ; final Type outer = TypeUtils . getOuter ( type ) ; if ( outer == null ) { // not inner class res = generics ; } else { final LinkedHashMap < String , Type > outerGenerics ; if ( outer instanceof ParameterizedType ) { // outer generics declared in field definition ( ignorance ...
public class GPathResult { /** * A helper method to allow GPathResults to work with subscript operators * @ param index an index * @ param newValue the value to put at the given index */ public void putAt ( final int index , final Object newValue ) { } }
final GPathResult result = ( GPathResult ) getAt ( index ) ; if ( newValue instanceof Closure ) { result . replaceNode ( ( Closure ) newValue ) ; } else { result . replaceBody ( newValue ) ; }
public class Materialize { /** * Set the color for the statusBar * @ param statusBarColor */ public void setStatusBarColor ( int statusBarColor ) { } }
if ( mBuilder . mScrimInsetsLayout != null ) { mBuilder . mScrimInsetsLayout . setInsetForeground ( statusBarColor ) ; mBuilder . mScrimInsetsLayout . getView ( ) . invalidate ( ) ; }
public class MoneyUtils { /** * Evaluates the { @ link MathContext } from the given { @ link MonetaryContext } . * @ param monetaryContext the { @ link MonetaryContext } * @ param defaultMode the default { @ link RoundingMode } , to be used if no one is set * in { @ link MonetaryContext } . * @ return the corre...
MathContext ctx = monetaryContext . get ( MathContext . class ) ; if ( Objects . nonNull ( ctx ) ) { return ctx ; } RoundingMode roundingMode = monetaryContext . get ( RoundingMode . class ) ; if ( roundingMode == null ) { roundingMode = Optional . ofNullable ( defaultMode ) . orElse ( HALF_EVEN ) ; } return new MathCo...
public class Matrix4f { /** * Apply a symmetric orthographic projection transformation for a left - handed coordinate system * using OpenGL ' s NDC z range of < code > [ - 1 . . + 1 ] < / code > to this matrix and store the result in < code > dest < / code > . * This method is equivalent to calling { @ link # ortho...
return orthoSymmetricLH ( width , height , zNear , zFar , false , dest ) ;
public class ApikeyManager { /** * override this one to change fingerprint strategy */ protected Apikey createFromMapInternal ( @ Nullable String user , long start , long duration , @ Nullable Arr roles , Map < String , Object > nameAndValMap ) { } }
return createFromMapWithFingerprint ( user , start , duration , roles , nameAndValMap , randomFingerprint ( ) ) ;
public class Tools { /** * Launches the default browser to display a URL . * @ param url the URL to be displayed * @ since 4.1 */ static void openURL ( String url ) { } }
try { openURL ( new URL ( url ) ) ; } catch ( MalformedURLException ex ) { Tools . showError ( ex ) ; }
public class GeneratePluginConfigListener { /** * ( non - Javadoc * @ see com . ibm . ws . container . service . state . ApplicationStateListener # applicationStarting ( com . ibm . ws . container . service . app . deploy . ApplicationInfo ) */ @ Override public void applicationStarting ( ApplicationInfo appInfo ) th...
setFutureGeneratePluginTask ( ) ; this . appsInService ++ ; if ( smgr != null ) this . cookieNames . put ( appInfo . getName ( ) , smgr . getDefaultAffinityCookie ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "application starting, add app to cookie map. app...
public class Strings { /** * Splits string using specified string separator and returns trimmed values . Returns null if string argument is null * and empty list if is empty . * @ param string source string , * @ param separator string used as separator . * @ return strings list , possible empty . */ public sta...
final int separatorLength = separator . length ( ) ; final List < String > list = new ArrayList < String > ( ) ; int fromIndex = 0 ; for ( ; ; ) { int endIndex = string . indexOf ( separator , fromIndex ) ; if ( endIndex == - 1 ) { break ; } if ( fromIndex < endIndex ) { list . add ( string . substring ( fromIndex , en...
public class JdbcRepositories { /** * fillFieldDefinitionData . * @ param fieldDefinitionObject josn model * @ return { @ link FieldDefinition } * @ throws JSONException JSONException */ private static FieldDefinition fillFieldDefinitionData ( final JSONObject fieldDefinitionObject ) throws JSONException { } }
final FieldDefinition ret = new FieldDefinition ( ) ; ret . setName ( fieldDefinitionObject . getString ( NAME ) ) ; ret . setDescription ( fieldDefinitionObject . optString ( DESCRIPTION ) ) ; ret . setType ( fieldDefinitionObject . getString ( TYPE ) ) ; ret . setNullable ( fieldDefinitionObject . optBoolean ( NULLAB...
public class LocalTime { /** * Obtains the current time from the specified clock . * This will query the specified clock to obtain the current time . * Using this method allows the use of an alternate clock for testing . * The alternate clock may be introduced using { @ link Clock dependency injection } . * @ p...
Objects . requireNonNull ( clock , "clock" ) ; // inline OffsetTime factory to avoid creating object and InstantProvider checks final Instant now = clock . instant ( ) ; // called once ZoneOffset offset = clock . getZone ( ) . getRules ( ) . getOffset ( now ) ; long localSecond = now . getEpochSecond ( ) + offset . get...
public class OutputProperties { /** * Searches for the property with the specified key in the property list . * If the key is not found in this property list , the default property list , * and its defaults , recursively , are then checked . The method returns * < code > null < / code > if the property is not fou...
if ( key . startsWith ( OutputPropertiesFactory . S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL ) ) key = OutputPropertiesFactory . S_BUILTIN_EXTENSIONS_UNIVERSAL + key . substring ( OutputPropertiesFactory . S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN ) ; return m_properties . getProperty ( key ) ;
public class DeviceProxyDAODefaultImpl { public DeviceDataHistory [ ] attribute_history ( final DeviceProxy deviceProxy , final String attname ) throws DevFailed { } }
int hist_depth = 10 ; final DbDatum data = get_property ( deviceProxy , "poll_ring_depth" ) ; if ( ! data . is_empty ( ) ) { hist_depth = data . extractLong ( ) ; } return attribute_history ( deviceProxy , attname , hist_depth ) ;
public class DefaultGroovyMethods { /** * Create an array composed of the elements of the first array minus the * elements of the given Iterable . * @ param self an array * @ param removeMe a Collection of elements to remove * @ return an array with the supplied elements removed * @ since 1.5.5 */ @ SuppressW...
return ( T [ ] ) minus ( toList ( self ) , removeMe ) . toArray ( ) ;
public class DefaultNamespaceService { /** * Do compilation of the namespace resource . * @ param resourceLocation { @ link String } , the resource location to compile * @ throws IndexingFailure Thrown if an error occurred while indexing * @ throws ResourceDownloadError Thrown if an error occurred downloading *...
final ResolvedResource resolved = resourceCache . resolveResource ( NAMESPACES , resourceLocation ) ; final File resourceCopy = resolved . getCacheResourceCopy ( ) ; namespaceIndexerService . indexNamespace ( resourceLocation , resolved . getCacheResourceCopy ( ) ) ; final String indexPath = asPath ( resourceCopy . get...
public class ObjectMapperFactory { /** * / * package private */ static void registerModule ( final ObjectMapper objectMapper , final String className ) { } }
final Optional < Class < ? extends Module > > moduleClass = getClass ( className ) ; if ( moduleClass . isPresent ( ) ) { try { final Module module = moduleClass . get ( ) . newInstance ( ) ; objectMapper . registerModule ( module ) ; // CHECKSTYLE . OFF : IllegalCatch - Catch any exceptions thrown by reflection or the...
public class AuthenticationRequest { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case CREDENTIALS : return isSetCredentials ( ) ; } throw new IllegalStateException ( ) ;
public class SmoothieMap { /** * Replaces the entry for the specified key only if it is currently mapped to some value . * @ param key key with which the specified value is associated * @ param value value to be associated with the specified key * @ return the previous value associated with the specified key , or...
long hash , allocIndex ; Segment < K , V > segment ; V oldValue ; if ( ( allocIndex = ( segment = segment ( segmentIndex ( hash = keyHashCode ( key ) ) ) ) . find ( this , hash , key ) ) > 0 ) { oldValue = segment . readValue ( allocIndex ) ; segment . writeValue ( allocIndex , value ) ; return oldValue ; } return null...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RectifiedGridDomainType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link RectifiedGridDomainType ...
return new JAXBElement < RectifiedGridDomainType > ( _RectifiedGridDomain_QNAME , RectifiedGridDomainType . class , null , value ) ;
public class MmffAromaticTypeMapping { /** * From a provided set of cycles find the 5/6 member cycles that fit the MMFF aromaticity * definition - { @ link # isAromaticRing ( int [ ] , int [ ] , int [ ] , boolean [ ] ) } . The cycles of size 6 * are listed first . * @ param cycles initial set of cycles from * @...
// loop control variables , the while loop continual checks all cycles // until no changes are found boolean found ; boolean [ ] checked = new boolean [ cycles . length ] ; // stores the aromatic atoms as a bit set and the aromatic bonds as // a hash set . the aromatic bonds are the result of this method but the // aro...
public class YamlShardingDataSourceFactory { /** * Create sharding data source . * @ param yamlBytes YAML bytes for rule configuration of databases and tables sharding with data sources * @ return sharding data source * @ throws SQLException SQL exception * @ throws IOException IO exception */ public static Dat...
YamlRootShardingConfiguration config = YamlEngine . unmarshal ( yamlBytes , YamlRootShardingConfiguration . class ) ; return ShardingDataSourceFactory . createDataSource ( config . getDataSources ( ) , new ShardingRuleConfigurationYamlSwapper ( ) . swap ( config . getShardingRule ( ) ) , config . getProps ( ) ) ;
public class UnionSet { /** * Triggers combining . */ @ Override public boolean removeAll ( Collection < ? > c ) { } }
combine ( ) ; if ( combined == null ) combined = new HashSet < > ( ) ; return combined . removeAll ( c ) ;
public class SuffixBuilder { /** * Puts a key - value pair into the suffix . * @ param key the key * @ param value the value * @ return this */ @ SuppressWarnings ( { } }
"null" , "unused" } ) public @ NotNull SuffixBuilder put ( @ NotNull String key , @ NotNull Object value ) { if ( key == null ) { throw new IllegalArgumentException ( "Key must not be null" ) ; } if ( value != null ) { validateValueType ( value ) ; parameterMap . put ( key , value ) ; } return this ;
public class ExecutionContextImpl { /** * { @ inheritDoc } */ @ Override public void close ( ) { } }
// at the moment the only thing that might need to happen is to stop the timeout . . . // however , if execution has completed normally and as designed , the timeout will already be stopped // one day there might be more things that need closing if ( this . timeout != null ) { this . timeout . stop ( ) ; } metricRecord...
public class Result { /** * The projecting result value at the given index as a Blob object * @ param index The select result index . * @ return The Blob object . */ @ Override public Blob getBlob ( int index ) { } }
check ( index ) ; final Object obj = fleeceValueToObject ( index ) ; return obj instanceof Blob ? ( Blob ) obj : null ;
public class Cluster { /** * Cluster operations that are waiting to be started . * @ return Cluster operations that are waiting to be started . */ public java . util . List < String > getPendingActions ( ) { } }
if ( pendingActions == null ) { pendingActions = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return pendingActions ;
public class TypeLoader { /** * Loads the class as the given super - type . * Examples : * < pre > * / / import static { @ link org . fest . reflect . core . Reflection # type ( String ) org . fest . reflect . core . Reflection . type } ; * / / Loads the class ' org . republic . Jedi ' * Class & lt ; ? & gt ;...
checkNotNull ( superType ) ; try { return checkNotNull ( loadType ( ) . asSubclass ( superType ) ) ; } catch ( Throwable t ) { String format = "Unable to load class '%s' as %s using ClassLoader %s" ; throw new ReflectionError ( String . format ( format , name , superType . getName ( ) , classLoader ) , t ) ; }
public class TldFernClassifier { /** * Renormalizes fern . numP to avoid overflow */ public void renormalizeP ( ) { } }
int targetMax = maxP / 20 ; for ( int i = 0 ; i < managers . length ; i ++ ) { TldFernManager m = managers [ i ] ; for ( int j = 0 ; j < m . table . length ; j ++ ) { TldFernFeature f = m . table [ j ] ; if ( f == null ) continue ; f . numP = targetMax * f . numP / maxP ; } } maxP = targetMax ;
public class CmsResourceManager { /** * Checks if there is a resource type with a given name whose id matches the given id . < p > * This will return ' false ' if no resource type with the given name is registered . < p > * @ param name a resource type name * @ param id a resource type id * @ return true if a m...
if ( hasResourceType ( name ) ) { try { return getResourceType ( name ) . getTypeId ( ) == id ; } catch ( Exception e ) { // should never happen because we already checked with hasResourceType , still have to // catch it so the compiler is happy LOG . error ( e . getLocalizedMessage ( ) , e ) ; return false ; } } else ...
public class References { /** * Gets an optional component reference that matches specified locator and * matching to the specified type . * @ param type the Class type that defined the type of the result . * @ param locator the locator to find references by . * @ return a matching component reference or null i...
try { List < T > components = find ( type , locator , false ) ; return components . size ( ) > 0 ? components . get ( 0 ) : null ; } catch ( Exception ex ) { return null ; }
public class ScriptEvaluatorFactory { /** * / * ( non - Javadoc ) * @ see org . danann . cernunnos . cache . CacheHelper . Factory # createObject ( java . lang . Object ) */ public ScriptEvaluator createObject ( Tuple < ScriptEngine , String > key ) { } }
return new ScriptEvaluator ( key . first , key . second ) ;
public class AbstractXMLSerializer { /** * This method handles the case , if all namespace context entries should be * emitted on the root element . * @ param aAttrMap */ protected final void handlePutNamespaceContextPrefixInRoot ( @ Nonnull final Map < QName , String > aAttrMap ) { } }
if ( m_aSettings . isEmitNamespaces ( ) && m_aNSStack . size ( ) == 1 && m_aSettings . isPutNamespaceContextPrefixesInRoot ( ) ) { // The only place where the namespace context prefixes are added to the // root element for ( final Map . Entry < String , String > aEntry : m_aRootNSMap . entrySet ( ) ) { aAttrMap . put (...
public class StringBuilders { /** * Appends in the following format : key = double quoted value . * @ param sb a string builder * @ param entry a map entry * @ return { @ code key = " value " } */ public static StringBuilder appendKeyDqValue ( final StringBuilder sb , final Entry < String , String > entry ) { } }
return appendKeyDqValue ( sb , entry . getKey ( ) , entry . getValue ( ) ) ;
public class ApnsClientBuilder { /** * < p > Sets the TLS credentials for the client under construction using the data from the given PKCS # 12 input stream . * Clients constructed with TLS credentials will use TLS - based authentication when sending push notifications . The * PKCS # 12 data < em > must < / em > co...
final X509Certificate x509Certificate ; final PrivateKey privateKey ; try { final KeyStore . PrivateKeyEntry privateKeyEntry = P12Util . getFirstPrivateKeyEntryFromP12InputStream ( p12InputStream , p12Password ) ; final Certificate certificate = privateKeyEntry . getCertificate ( ) ; if ( ! ( certificate instanceof X50...
public class OSchemaHelper { /** * Set linked class to a current property * @ param className class name to set as a linked class * @ return this helper */ public OSchemaHelper linkedClass ( String className ) { } }
checkOProperty ( ) ; OClass linkedToClass = schema . getClass ( className ) ; if ( linkedToClass == null ) throw new IllegalArgumentException ( "Target OClass '" + className + "' to link to not found" ) ; if ( ! Objects . equal ( linkedToClass , lastProperty . getLinkedClass ( ) ) ) { lastProperty . setLinkedClass ( li...
public class Start { /** * Called by 199 API . */ public boolean begin ( Class < ? > docletClass , Iterable < String > options , Iterable < ? extends JavaFileObject > fileObjects ) { } }
this . docletClass = docletClass ; List < String > opts = new ArrayList < > ( ) ; for ( String opt : options ) opts . add ( opt ) ; return begin ( opts , fileObjects ) . isOK ( ) ;
public class MsWordUtils { /** * 保存word文档 , 不关闭当前文档 * @ param path 路径 * @ throws IOException 异常 * @ throws NoSuchMethodException 异常 * @ throws IllegalAccessException 异常 * @ throws InvocationTargetException 异常 */ public static void writeTo ( String path ) throws IOException , NoSuchMethodException , IllegalAcc...
createXwpfDocumentIfNull ( ) ; MsUtils . writeTo ( xwpfDocument , path ) ;
public class BasicBinder { /** * Register an UnMarshaller with the given source and target class . * The unmarshaller is used as follows : Instances of the source can be marshalled into the target class . * @ param source The source ( input ) class * @ param target The target ( output ) class * @ param converte...
Class < ? extends Annotation > scope = matchImplementationToScope ( converter . getClass ( ) ) ; registerUnmarshaller ( new ConverterKey < S , T > ( source , target , scope == null ? DefaultBinding . class : scope ) , converter ) ;
public class LegacyAddress { /** * Construct a { @ link LegacyAddress } from its base58 form . * @ param params * expected network this address is valid for , or null if if the network should be derived from the * base58 * @ param base58 * base58 - encoded textual form of the address * @ throws AddressForma...
byte [ ] versionAndDataBytes = Base58 . decodeChecked ( base58 ) ; int version = versionAndDataBytes [ 0 ] & 0xFF ; byte [ ] bytes = Arrays . copyOfRange ( versionAndDataBytes , 1 , versionAndDataBytes . length ) ; if ( params == null ) { for ( NetworkParameters p : Networks . get ( ) ) { if ( version == p . getAddress...
public class Interceptor { /** * Performs a { @ link View # draw ( Canvas ) } call on the given { @ link View } . */ protected final void invokeDraw ( View view , Canvas canvas ) { } }
final ViewProxy proxy = ( ViewProxy ) view ; proxy . invokeDraw ( canvas ) ;
public class ExtensionAutoUpdate { /** * Processes the given add - on changes . * @ param caller the caller to set as parent of shown dialogues * @ param changes the changes that will be processed */ void processAddOnChanges ( Window caller , AddOnDependencyChecker . AddOnChangesResult changes ) { } }
if ( addonsDialog != null ) { addonsDialog . setDownloadingUpdates ( ) ; } if ( getView ( ) != null ) { Set < AddOn > addOns = new HashSet < > ( changes . getUninstalls ( ) ) ; addOns . addAll ( changes . getOldVersions ( ) ) ; Set < Extension > extensions = new HashSet < > ( ) ; extensions . addAll ( changes . getUnlo...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getColorFidelity ( ) { } }
if ( colorFidelityEClass == null ) { colorFidelityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 503 ) ; } return colorFidelityEClass ;
public class Value { /** * Returns an { @ code INT64 } value . * @ param v the value , which may be null */ public static Value int64 ( @ Nullable Long v ) { } }
return new Int64Impl ( v == null , v == null ? 0 : v ) ;
public class InterceptorTypeImpl { /** * If not already created , a new < code > post - construct < / code > element will be created and returned . * Otherwise , the first existing < code > post - construct < / code > element will be returned . * @ return the instance defined for the element < code > post - constru...
List < Node > nodeList = childNode . get ( "post-construct" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LifecycleCallbackTypeImpl < InterceptorType < T > > ( this , "post-construct" , childNode , nodeList . get ( 0 ) ) ; } return createPostConstruct ( ) ;
public class RxLoaderManager { /** * Get an instance of the { @ code RxLoaderManager } that is tied to the lifecycle of the given * { @ link android . app . Fragment } . If you are using the support library , then you should use * { @ link me . tatarka . rxloader . RxLoaderManagerCompat # get ( android . support . ...
if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . JELLY_BEAN_MR1 ) { throw new UnsupportedOperationException ( "Method only valid in api 17 and above, use RxLoaderManagerCompat to support older versions (requires support library)" ) ; } RxLoaderBackendNestedFragment manager = ( RxLoaderBackendNestedFragment ) fr...
public class LiveEventsInner { /** * Updates a existing Live Event . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param liveEventName The name of the Live Event . * @ param parameters Live Event properties ...
return beginUpdateWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters ) . map ( new Func1 < ServiceResponse < LiveEventInner > , LiveEventInner > ( ) { @ Override public LiveEventInner call ( ServiceResponse < LiveEventInner > response ) { return response . body ( ) ; } } ) ;
public class KeyVaultClientImpl { /** * Deletes a key of any type from storage in Azure Key Vault . The delete key operation cannot be used to remove individual versions of a key . This operation removes the cryptographic material associated with the key , which means the key is not usable for Sign / Verify , Wrap / Un...
return deleteKeyWithServiceResponseAsync ( vaultBaseUrl , keyName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class XlsMapper { /** * Excelファイルの複数シートを読み込み 、 任意のクラスにマップする 。 * < p > 複数のシートの形式を一度に読み込む際に使用します 。 < / p > * @ param xlsIn 読み込み元のExcelファイルのストリーム 。 * @ param classes マッピング先のクラスタイプの配列 。 * @ return マッピングした複数のシートの結果 。 * { @ link Configuration # isIgnoreSheetNotFound ( ) } の値がtrueで 、 シートが見つからない場合 、 マ...
return loader . loadMultipleDetail ( xlsIn , classes ) ;
public class AbstractOAuth1ApiBinding { /** * Returns an { @ link FormHttpMessageConverter } to be used by the internal { @ link RestTemplate } . * By default , the message converter is set to use " UTF - 8 " character encoding . * Override to customize the message converter ( for example , to set supported media t...
FormHttpMessageConverter converter = new FormHttpMessageConverter ( ) ; converter . setCharset ( Charset . forName ( "UTF-8" ) ) ; List < HttpMessageConverter < ? > > partConverters = new ArrayList < HttpMessageConverter < ? > > ( ) ; partConverters . add ( new ByteArrayHttpMessageConverter ( ) ) ; StringHttpMessageCon...
public class MapOnlyJobBuilder { /** * Sets the default named output specs . By using this method one can use an arbitrary number of named outputs * without pre - defining them beforehand . */ public void setDefaultNamedOutput ( OutputFormat outputFormat , Class keyClass , Class valueClass ) throws TupleMRException {...
setDefaultNamedOutput ( outputFormat , keyClass , valueClass , null ) ;
public class CmsSystemInfo { /** * Returns an absolute path ( to a directory or a file in the " real " file system ) from a path relative to * the web application folder of OpenCms . < p > * If the provided path is already absolute , then it is returned unchanged . * If the provided path is a folder , the result ...
if ( ( path == null ) || ( getWebApplicationRfsPath ( ) == null ) ) { return null ; } // check for absolute path is system depended , let ' s just use the standard check File f = new File ( path ) ; if ( f . isAbsolute ( ) ) { // apparently this is an absolute path already path = f . getAbsolutePath ( ) ; if ( f . isDi...
public class OperaDesktopDriver { /** * Get an item in a language independent way from its stringId . * @ param stringId StringId as found in standard _ menu . ini */ public QuickMenuItem getQuickMenuItemByStringId ( String stringId ) { } }
String text = desktopUtils . getString ( stringId , true ) ; return desktopWindowManager . getQuickMenuItemByText ( text ) ;
public class MessageInfo { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( MESSAGE_INFO_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class EntityType { /** * Returns all atomic attributes . In case of compound attributes ( attributes consisting of atomic * attributes ) only the descendant atomic attributes are returned . The compound attribute itself * is not returned . * < p > In case EntityType extends other EntityType then the attrib...
return ( ) -> getCachedOwnAttrs ( ) . values ( ) . stream ( ) . filter ( attr -> attr . getDataType ( ) != COMPOUND ) . iterator ( ) ;
public class Internal { /** * Returns a 2 or 4 byte qualifier based on the timestamp and the flags . If * the timestamp is in seconds , this returns a 2 byte qualifier . If it ' s in * milliseconds , returns a 4 byte qualifier * @ param timestamp A Unix epoch timestamp in seconds or milliseconds * @ param flags...
final long base_time ; if ( ( timestamp & Const . SECOND_MASK ) != 0 ) { // drop the ms timestamp to seconds to calculate the base timestamp base_time = ( ( timestamp / 1000 ) - ( ( timestamp / 1000 ) % Const . MAX_TIMESPAN ) ) ; final int qual = ( int ) ( ( ( timestamp - ( base_time * 1000 ) << ( Const . MS_FLAG_BITS ...
public class GlobalForwardingRuleClient { /** * Creates a GlobalForwardingRule resource in the specified project using the data included in the * request . * < p > Sample code : * < pre > < code > * try ( GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient . create ( ) ) { * Pro...
InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . setForwardingRuleResource ( forwardingRuleResource ) . build ( ) ; return insertGlobalForwardingRule ( request ) ;
public class StandardBullhornData { /** * { @ inheritDoc } */ @ Override public < T extends EditHistoryEntity > EditHistoryListWrapper queryEntityForEditHistory ( Class < T > entityType , String where , Set < String > fieldSet , QueryParams params ) { } }
return this . handleQueryForEntityEditHistory ( entityType , where , fieldSet , params ) ;
public class DefaultStreamFilenameGenerator { /** * Generate stream directory based on relative scope path . The base directory is * < pre > * streams * < / pre > * , e . g . a scope * < pre > * / application / one / two / * < / pre > * will generate a directory * < pre > * / streams / one / two / ...
final StringBuilder result = new StringBuilder ( ) ; final IScope app = ScopeUtils . findApplication ( scope ) ; final String prefix = "streams/" ; while ( scope != null && scope != app ) { result . insert ( 0 , scope . getName ( ) + "/" ) ; scope = scope . getParent ( ) ; } if ( result . length ( ) == 0 ) { return pre...
public class SipCall { /** * @ see org . cafesip . sipunit . MessageListener # processEvent ( java . util . EventObject ) */ public void processEvent ( EventObject event ) // for asynchronous // ( nonblocking ) response // handling { } }
synchronized ( this ) { } // wail til message sending has finished ( transaction attribute set ) if ( event instanceof ResponseEvent ) { processResponse ( ( ResponseEvent ) event ) ; } else if ( event instanceof TimeoutEvent ) { processTimeout ( ( TimeoutEvent ) event ) ; } // note , requests don ' t come through here ...
public class RecurlyClient { /** * Get the subscriptions for an { @ link Account } given query params * Returns subscriptions associated with an account * @ param accountCode recurly account id * @ param state { @ link SubscriptionState } * @ param params { @ link QueryParams } * @ return Subscriptions on the...
if ( state != null ) params . put ( "state" , state . getType ( ) ) ; return doGET ( Account . ACCOUNT_RESOURCE + "/" + accountCode + Subscriptions . SUBSCRIPTIONS_RESOURCE , Subscriptions . class , params ) ;
public class FileUtils { /** * Copy the file using streams . * @ param in source . * @ param out destination . * @ see java . nio . channels . FileChannel # transferTo ( long , long , java . nio . channels . WritableByteChannel ) * @ return the transferred byte count . * @ throws IOException */ public static ...
FileChannel source = null ; FileChannel destination = null ; try { source = in . getChannel ( ) ; destination = out . getChannel ( ) ; return source . transferTo ( 0 , source . size ( ) , destination ) ; } finally { CloseableUtils . close ( source ) ; CloseableUtils . close ( destination ) ; }
public class SqlContextImpl { /** * バインドパラメータ配列取得 * @ return バインドパラメータ配列 */ public Parameter [ ] getBindParameters ( ) { } }
return bindNames . stream ( ) . map ( this :: getParam ) . filter ( Objects :: nonNull ) . toArray ( Parameter [ ] :: new ) ;
public class CmsContextMenuItem { /** * Generates the HTML for a menu item . < p > * @ param hasSubMenu signals if this menu has a sub menu * @ return the HTML for the menu item */ protected String getMenuItemHtml ( boolean hasSubMenu ) { } }
StringBuffer html = new StringBuffer ( ) ; if ( hasSubMenu ) { // if this menu item has a sub menu show the arrow - icon behind the text of the icon html . append ( "<div class=\"" ) ; html . append ( I_CmsLayoutBundle . INSTANCE . contextmenuCss ( ) . arrow ( ) ) . append ( " " ) . append ( I_CmsButton . ICON_FONT ) ....
public class BigtableBufferedMutator { /** * Create a { @ link RetriesExhaustedWithDetailsException } if there were any async exceptions and * send it to the { @ link org . apache . hadoop . hbase . client . BufferedMutator . ExceptionListener } . */ private void handleExceptions ( ) throws RetriesExhaustedWithDetail...
RetriesExhaustedWithDetailsException exceptions = getExceptions ( ) ; if ( exceptions != null ) { listener . onException ( exceptions , this ) ; }
public class FSNamesystem { /** * Set owner for an existing file . * @ throws IOException */ public void setOwner ( String src , String username , String group ) throws IOException { } }
INode [ ] inodes = null ; writeLock ( ) ; try { if ( isInSafeMode ( ) ) { throw new SafeModeException ( "Cannot set permission for " + src , safeMode ) ; } inodes = dir . getExistingPathINodes ( src ) ; if ( isPermissionCheckingEnabled ( inodes ) ) { FSPermissionChecker pc = checkOwner ( src , inodes ) ; if ( ! pc . is...
public class SingleFilterAdapter { /** * Determine if the untyped filter is supported . * @ param context a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterAdapterContext } object . * @ param hbaseFilter a { @ link org . apache . hadoop . hbase . filter . Filter } object . * @ return...
Preconditions . checkArgument ( isFilterAProperSublcass ( hbaseFilter ) ) ; return adapter . isFilterSupported ( context , getTypedFilter ( hbaseFilter ) ) ;
public class NetworkUtils { /** * Read http response from a given http connection * @ param connection the connection to read response * @ return the byte [ ] in response body , or new byte [ 0 ] if failed to read */ public static byte [ ] readHttpResponse ( HttpURLConnection connection ) { } }
byte [ ] res ; try { if ( connection . getResponseCode ( ) != HttpURLConnection . HTTP_OK ) { LOG . log ( Level . WARNING , "Http Response not OK: " + connection . getResponseCode ( ) ) ; } } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed to get response code" , e ) ; return new byte [ 0 ] ; } int respo...
public class BehaviorTreeLibrary { /** * Dispose behavior tree obtain by this library . * @ param treeReference the tree identifier . * @ param behaviorTree the tree to dispose . */ public void disposeBehaviorTree ( String treeReference , BehaviorTree < ? > behaviorTree ) { } }
if ( Task . TASK_CLONER != null ) { Task . TASK_CLONER . freeTask ( behaviorTree ) ; }
public class Documentation { /** * < pre > * Declares a single overview page . For example : * & lt ; pre & gt ; & lt ; code & gt ; documentation : * summary : . . . * overview : & amp ; # 40 ; = = include overview . md = = & amp ; # 41; * & lt ; / code & gt ; & lt ; / pre & gt ; * This is a shortcut for th...
java . lang . Object ref = overview_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; overview_ = s ; return s ; }
public class DatasetInfo { /** * Returns a builder for the DatasetInfo object given it ' s user - defined project and dataset ids . */ public static Builder newBuilder ( String projectId , String datasetId ) { } }
return newBuilder ( DatasetId . of ( projectId , datasetId ) ) ;
public class CollectionPartitionsInner { /** * Retrieves the usages ( most recent storage data ) for the given collection , split by partition . * @ param resourceGroupName Name of an Azure resource group . * @ param accountName Cosmos DB database account name . * @ param databaseRid Cosmos DB database rid . * ...
return ServiceFuture . fromResponse ( listUsagesWithServiceResponseAsync ( resourceGroupName , accountName , databaseRid , collectionRid ) , serviceCallback ) ;
public class CPDAvailabilityEstimateUtil { /** * Returns all the cpd availability estimates where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching cpd availability estimates */ public static List < CPDAvailabilityEstimate > findByUuid_C ...
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class DisksInner { /** * Grants access to a disk . * @ param resourceGroupName The name of the resource group . * @ param diskName The name of the managed disk that is being created . The name can ' t be changed after the disk is created . Supported characters for the name are a - z , A - Z , 0-9 and _ . The...
return ServiceFuture . fromResponse ( grantAccessWithServiceResponseAsync ( resourceGroupName , diskName , grantAccessData ) , serviceCallback ) ;
public class HillsRenderConfig { /** * call after initialization , after a set of changes to the settable properties or after forceReindex to initiate background indexing */ public HillsRenderConfig indexOnThread ( ) { } }
ShadeTileSource cache = tileSource ; if ( cache != null ) cache . applyConfiguration ( true ) ; return this ;
public class FeatureWebSecurityConfigImpl { /** * { @ inheritDoc } */ @ Override public boolean getAllowFailOverToAppDefined ( ) { } }
WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) ; if ( globalConfig != null ) return WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) . getAllowFailOverToAppDefined ( ) ; else return false ;
public class DebtModelPluginRepository { /** * Creates a new { @ link java . io . Reader } for the XML file that contains the model contributed by the given plugin . * @ param pluginKey the key of the plugin that contributes the XML file * @ return the reader , that must be closed once its use is finished . */ publ...
ClassLoader classLoader = contributingPluginKeyToClassLoader . get ( pluginKey ) ; String xmlFilePath = getXMLFilePath ( pluginKey ) ; return new InputStreamReader ( classLoader . getResourceAsStream ( xmlFilePath ) , StandardCharsets . UTF_8 ) ;
public class TaskClient { /** * Requeue pending tasks of a specific task type * @ return returns the number of tasks that have been requeued */ public String requeuePendingTasksByTaskType ( String taskType ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; return postForEntity ( "tasks/queue/requeue/{taskType}" , null , null , String . class , taskType ) ;
public class UpdateProductPackages { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param productPackageId the ID of the product package to update . * @ throws ApiException if the API request failed with one or more service errors . * @ throws R...
// Get the ProductPackageService . ProductPackageServiceInterface productPackageService = adManagerServices . get ( session , ProductPackageServiceInterface . class ) ; // Create a statement to select a single product package . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "id = :id" ) . orderB...
public class DisplacedList { /** * Inherited from ArrayList * @ param index * @ param element */ @ Override public void add ( int index , T element ) { } }
if ( displacement != null ) { super . add ( index - displacement , element ) ; } else { super . add ( index , element ) ; }