signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Log { /** * What a Terrible Failure : Report a condition that should never happen . The
* error will always be logged at level Constants . ASSERT despite the logging is
* disabled . Depending on system configuration , and on Android 2.2 + , a
* report may be added to the DropBoxManager and / or the process may be
* terminated immediately with an error dialog .
* On older Android version ( before 2.2 ) , the message is logged with the
* Assert level . Those log messages will always be logged .
* @ param object
* Used to compute the tag .
* @ param msg
* The message you would like logged .
* @ param tr
* The exception to log */
public static int wtf ( Object object , String msg , Throwable tr ) { } } | if ( object != null ) { return wtf ( object . getClass ( ) . getName ( ) , msg , tr ) ; } return 0 ; |
public class StorageReadManager { /** * Queues the given request . The Request will be checked against existing pending Requests . If necessary , this request
* will be adjusted to take advantage of an existing request ( i . e . , if it overlaps with an existing request , no actual
* Storage read will happen for this one , yet the result of the previous one will be used instead ) . The callbacks passed
* to the request will be invoked with either the result of the read or with the exception that caused the read to fail .
* @ param request The request to queue . */
void execute ( Request request ) { } } | log . debug ( "{}: StorageRead.Execute {}" , this . traceObjectId , request ) ; synchronized ( this . lock ) { Exceptions . checkNotClosed ( this . closed , this ) ; Request existingRequest = findOverlappingRequest ( request ) ; if ( existingRequest != null ) { // We found an overlapping request . Adjust the current request length .
int newLength = ( int ) ( existingRequest . getOffset ( ) + existingRequest . getLength ( ) - request . getOffset ( ) ) ; if ( newLength > 0 && newLength < request . getLength ( ) ) { request . adjustLength ( newLength ) ; existingRequest . addDependent ( request ) ; return ; } } this . pendingRequests . put ( request . getOffset ( ) , request ) ; } // Initiate the Storage Read .
executeStorageRead ( request ) ; |
public class LoggerFactory { /** * Create a compatible logging tag for Android based on the logger name . */
static final String createTag ( final String name ) { } } | if ( name . length ( ) <= MAX_TAG_LEN ) { return name ; } final char [ ] tag = name . toCharArray ( ) ; final int arrayLen = tag . length ; int len = 0 ; int mark = 0 ; for ( int i = 0 ; i < arrayLen ; i ++ , len ++ ) { if ( tag [ i ] == '.' ) { len = mark ; if ( tag [ len ] != '.' ) { len ++ ; } mark = len ; if ( i + 1 < arrayLen && tag [ i + 1 ] != '.' ) { mark ++ ; } } tag [ len ] = tag [ i ] ; } if ( len > MAX_TAG_LEN ) { int i = 0 ; mark -- ; for ( int j = 0 ; j < len ; j ++ ) { if ( tag [ j ] == '.' && ( ( j != mark ) || ( i >= MAX_TAG_LEN - 1 ) ) ) { continue ; } tag [ i ++ ] = tag [ j ] ; } len = i ; if ( len > MAX_TAG_LEN ) { len = MAX_TAG_LEN ; } } return new String ( tag , 0 , len ) ; |
public class SequenceQuality { /** * Creates a phred sequence quality containing only given values of quality .
* @ param qualityValue value to fill the quality values with
* @ param length size of quality string */
public static SequenceQuality getUniformQuality ( byte qualityValue , int length ) { } } | byte [ ] data = new byte [ length ] ; Arrays . fill ( data , qualityValue ) ; return new SequenceQuality ( data , true ) ; |
public class ELKIServiceLoader { /** * Parse a single line from a service registry file .
* @ param parent Parent class
* @ param line Line to read */
private static void parseLine ( Class < ? > parent , char [ ] line , int begin , int end ) { } } | while ( begin < end && line [ begin ] == ' ' ) { begin ++ ; } if ( begin >= end || line [ begin ] == '#' ) { return ; // Empty / comment lines are okay , continue
} // Find end of class name :
int cend = begin + 1 ; while ( cend < end && line [ cend ] != ' ' ) { cend ++ ; } // Class name :
String cname = new String ( line , begin , cend - begin ) ; ELKIServiceRegistry . register ( parent , cname ) ; for ( int abegin = cend + 1 , aend = - 1 ; abegin < end ; abegin = aend + 1 ) { // Skip whitespace :
while ( abegin < end && line [ abegin ] == ' ' ) { abegin ++ ; } // Find next whitespace :
aend = abegin + 1 ; while ( aend < end && line [ aend ] != ' ' ) { aend ++ ; } ELKIServiceRegistry . registerAlias ( parent , new String ( line , abegin , aend - abegin ) , cname ) ; } return ; |
public class JavaCompilerFactory { /** * Tries to guess the class name by convention . So for compilers
* following the naming convention
* org . apache . commons . jci . compilers . SomeJavaCompiler
* you can use the short - hands " some " / " Some " / " SOME " . Otherwise
* you have to provide the full class name . The compiler is
* getting instanciated via ( cached ) reflection .
* @ param pHint
* @ return JavaCompiler or null */
public JavaCompiler createCompiler ( final String pHint ) { } } | final String className ; if ( pHint . indexOf ( '.' ) < 0 ) { className = "org.drools.compiler.commons.jci.compilers." + ClassUtils . toJavaCasing ( pHint ) + "JavaCompiler" ; } else { className = pHint ; } Class clazz = ( Class ) classCache . get ( className ) ; if ( clazz == null ) { try { clazz = Class . forName ( className ) ; classCache . put ( className , clazz ) ; } catch ( ClassNotFoundException e ) { clazz = null ; } } if ( clazz == null ) { return null ; } try { return ( JavaCompiler ) clazz . newInstance ( ) ; } catch ( Throwable t ) { return null ; } |
public class AbstractValueConverterToContainer { /** * This method performs the { @ link # convert ( Object , Object , GenericType ) conversion } for { @ link String }
* values .
* @ param < T > is the generic type of { @ code targetType } .
* @ param stringValue is the { @ link String } value to convert .
* @ param valueSource describes the source of the value or { @ code null } if NOT available .
* @ param targetType is the { @ link # getTargetType ( ) target - type } to convert to .
* @ return the converted container . */
protected < T extends CONTAINER > T convertFromString ( String stringValue , Object valueSource , GenericType < T > targetType ) { } } | List < String > stringList = new ArrayList < > ( ) ; int start = 0 ; int length = stringValue . length ( ) ; while ( start < length ) { int end ; int offset = 1 ; if ( stringValue . startsWith ( ELEMENT_ESCAPE_START , start ) ) { int newStart = start + ELEMENT_ESCAPE_START . length ( ) ; end = stringValue . indexOf ( ELEMENT_ESCAPE_END , newStart ) ; if ( end > 0 ) { start = newStart ; offset = ELEMENT_ESCAPE_END . length ( ) ; } else { // actually a syntax error , lets be tolerant and ignore it . . .
end = stringValue . indexOf ( ELEMENT_SEPARATOR , start ) ; } } else { end = stringValue . indexOf ( ELEMENT_SEPARATOR , start ) ; } if ( end < 0 ) { end = length ; } String element = stringValue . substring ( start , end ) . trim ( ) ; stringList . add ( element ) ; if ( offset > 1 ) { end = stringValue . indexOf ( ELEMENT_SEPARATOR , end + offset ) ; if ( end < 0 ) { end = length ; } } start = end + 1 ; } int size = stringList . size ( ) ; T container = createContainer ( targetType , size ) ; for ( int i = 0 ; i < size ; i ++ ) { convertContainerEntry ( stringList . get ( i ) , i , container , valueSource , targetType , stringValue ) ; } return container ; |
public class HexInputStream { /** * Fills the buffer with next bytes from the stream .
* @ param buffer buffer to be filled
* @ return the size of the buffer */
public int readPacket ( @ NonNull byte [ ] buffer ) throws IOException { } } | int i = 0 ; while ( i < buffer . length ) { if ( localPos < size ) { buffer [ i ++ ] = localBuf [ localPos ++ ] ; continue ; } bytesRead += size = readLine ( ) ; if ( size == 0 ) break ; // end of file reached
} return i ; |
public class InMemoryResponseStore { /** * { @ inheritDoc } */
@ Override public void addResponse ( Response response ) { } } | logger . warn ( "Security response " + response . getAction ( ) + " triggered for user: " + response . getUser ( ) . getUsername ( ) ) ; responses . add ( response ) ; super . notifyListeners ( response ) ; |
public class URLUtils { /** * Adds a ' / ' prefix to the beginning of a path if one isn ' t present
* and removes trailing slashes if any are present .
* @ param path the path to normalize
* @ return a normalized ( with respect to slashes ) result */
public static String normalizeSlashes ( final String path ) { } } | // prepare
final StringBuilder builder = new StringBuilder ( path ) ; boolean modified = false ; // remove all trailing ' / ' s except the first one
while ( builder . length ( ) > 0 && builder . length ( ) != 1 && PATH_SEPARATOR == builder . charAt ( builder . length ( ) - 1 ) ) { builder . deleteCharAt ( builder . length ( ) - 1 ) ; modified = true ; } // add a slash at the beginning if one isn ' t present
if ( builder . length ( ) == 0 || PATH_SEPARATOR != builder . charAt ( 0 ) ) { builder . insert ( 0 , PATH_SEPARATOR ) ; modified = true ; } // only create string when it was modified
if ( modified ) { return builder . toString ( ) ; } return path ; |
public class SimpleElement { /** * This default implementation uses the { @ link # newChildrenInstance ( ) } to initialize the children set and wraps
* it in a private set implementation that automagically changes the parent of the elements based on the
* membership .
* @ return children of this element */
@ Nonnull public SortedSet < ? extends Element > getChildren ( ) { } } | if ( children == null ) { children = new ParentPreservingSet ( newChildrenInstance ( ) ) ; } return children ; |
public class LoggingConfiguration { /** * Shuts down blitz4j cleanly by flushing out all the async related
* messages . */
public void stop ( ) { } } | MessageBatcher batcher = null ; for ( String originalAppenderName : originalAsyncAppenderNameMap . keySet ( ) ) { String batcherName = AsyncAppender . class . getName ( ) + "." + originalAppenderName ; batcher = BatcherFactory . getBatcher ( batcherName ) ; if ( batcher == null ) { continue ; } batcher . stop ( ) ; } for ( String originalAppenderName : originalAsyncAppenderNameMap . keySet ( ) ) { String batcherName = AsyncAppender . class . getName ( ) + "." + originalAppenderName ; batcher = BatcherFactory . getBatcher ( batcherName ) ; if ( batcher == null ) { continue ; } BatcherFactory . removeBatcher ( batcherName ) ; } |
public class NYTCorpusDocumentParser { /** * Parse a file containing an XML document , into a DOM object .
* @ param filename
* A path to a valid file .
* @ param validating
* True iff validating should be turned on .
* @ return A DOM Object containing a parsed XML document or a null value if
* there is an error in parsing .
* @ throws ParserConfigurationException
* @ throws IOException
* @ throws SAXException */
private Document getDOMObject ( String filename , boolean validating ) throws SAXException , IOException , ParserConfigurationException { } } | // Create a builder factory
DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; if ( ! validating ) { factory . setValidating ( validating ) ; factory . setSchema ( null ) ; factory . setNamespaceAware ( false ) ; } DocumentBuilder builder = factory . newDocumentBuilder ( ) ; // Create the builder and parse the file
Document doc = builder . parse ( new File ( filename ) ) ; return doc ; |
public class DefaultDataEditorWidget { /** * { @ inheritDoc } */
@ Override public void onAboutToShow ( ) { } } | log . debug ( getId ( ) + ": onAboutToShow with refreshPolicy: " + dataProvider . getRefreshPolicy ( ) ) ; super . onAboutToShow ( ) ; dataProvider . addDataProviderListener ( this ) ; registerListeners ( ) ; if ( detailForm instanceof Widget ) { ( ( Widget ) detailForm ) . onAboutToShow ( ) ; } getTableWidget ( ) . onAboutToShow ( ) ; // lazy loading , if no list is present , load when widget is shown
// include RefreshPolicy given by DataProvider
if ( ( dataProvider . getRefreshPolicy ( ) != DataProvider . RefreshPolicy . NEVER ) && ( getTableWidget ( ) . isEmpty ( ) ) ) { executeFilter ( ) ; } else if ( ! getTableWidget ( ) . hasSelection ( ) ) { getTableWidget ( ) . selectRowObject ( 0 , this ) ; } |
public class Widgets { /** * Creates a label that triggers an action using the supplied text and handler . */
public static Label newActionLabel ( String text , ClickHandler onClick ) { } } | return newActionLabel ( text , null , onClick ) ; |
public class NonBlockingHashMapLong { /** * copies in progress . */
private void help_copy ( ) { } } | // Read the top - level CHM only once . We ' ll try to help this copy along ,
// even if it gets promoted out from under us ( i . e . , the copy completes
// and another KVS becomes the top - level copy ) .
CHM topchm = _chm ; if ( topchm . _newchm == null ) return ; // No copy in - progress
topchm . help_copy_impl ( false ) ; |
public class CmsJSONSearchConfigurationParser { /** * Helper for reading a mandatory String value list - throwing an Exception if parsing fails .
* @ param json The JSON object where the list should be read from .
* @ param key The key of the value to read .
* @ return The value from the JSON .
* @ throws JSONException thrown when parsing fails . */
protected static List < String > parseMandatoryStringValues ( JSONObject json , String key ) throws JSONException { } } | List < String > list = null ; JSONArray array = json . getJSONArray ( key ) ; list = new ArrayList < String > ( array . length ( ) ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { try { String entry = array . getString ( i ) ; list . add ( entry ) ; } catch ( JSONException e ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_OPTIONAL_STRING_ENTRY_UNPARSABLE_1 , key ) , e ) ; } } return list ; |
public class EhcacheStats { /** * Creates new { @ link net . anotheria . moskito . core . stats . StatValue } that holds the long value with given name
* and default intervals .
* @ param valueName name of the stat value .
* @ return { @ link net . anotheria . moskito . core . stats . StatValue } . */
private StatValue newLongStatValue ( String valueName ) { } } | StatValue sv = StatValueFactory . createStatValue ( 0L , valueName , Constants . getDefaultIntervals ( ) ) ; addStatValues ( sv ) ; return sv ; |
public class PdfSignatureAppearance { /** * Gets a new signature fied name that doesn ' t clash with any existing name .
* @ return a new signature fied name */
public String getNewSigName ( ) { } } | AcroFields af = writer . getAcroFields ( ) ; String name = "Signature" ; int step = 0 ; boolean found = false ; while ( ! found ) { ++ step ; String n1 = name + step ; if ( af . getFieldItem ( n1 ) != null ) { continue ; } n1 += "." ; found = true ; for ( Iterator it = af . getFields ( ) . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String fn = ( String ) it . next ( ) ; if ( fn . startsWith ( n1 ) ) { found = false ; break ; } } } name += step ; return name ; |
public class RuntimeCapability { /** * Creates a fully named capability from a { @ link # isDynamicallyNamed ( ) dynamically named } base
* capability . Capability providers should use this method to generate fully named capabilities in logic
* that handles dynamically named resources .
* @ param dynamicElement the dynamic portion of the full capability name . Cannot be { @ code null } or empty
* @ return the fully named capability .
* @ throws AssertionError if { @ link # isDynamicallyNamed ( ) } returns { @ code false } */
public RuntimeCapability < T > fromBaseCapability ( String ... dynamicElement ) { } } | assert isDynamicallyNamed ( ) ; assert dynamicElement != null ; assert dynamicElement . length > 0 ; return new RuntimeCapability < T > ( getName ( ) , serviceValueType , getServiceName ( ) , runtimeAPI , getRequirements ( ) , allowMultipleRegistrations , dynamicNameMapper , additionalPackages , dynamicElement ) ; |
public class CommonsMetadataEngine { /** * This method creates a table .
* @ param targetCluster the target cluster where the table will be created .
* @ param tableMetadata the table metadata .
* @ throws UnsupportedException if an operation is not supported .
* @ throws ExecutionException if an error happens . */
@ Override public final void createTable ( ClusterName targetCluster , TableMetadata tableMetadata ) throws UnsupportedException , ExecutionException { } } | try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating table [" + tableMetadata . getName ( ) . getName ( ) + "] in cluster [" + targetCluster . getName ( ) + "]" ) ; } createTable ( tableMetadata , connectionHandler . getConnection ( targetCluster . getName ( ) ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Catalog [" + tableMetadata . getName ( ) . getName ( ) + "] has been created successfully in cluster [" + targetCluster . getName ( ) + "]" ) ; } } finally { connectionHandler . endJob ( targetCluster . getName ( ) ) ; } |
public class GetCorsPolicyResult { /** * The CORS policy assigned to the container .
* @ param corsPolicy
* The CORS policy assigned to the container . */
public void setCorsPolicy ( java . util . Collection < CorsRule > corsPolicy ) { } } | if ( corsPolicy == null ) { this . corsPolicy = null ; return ; } this . corsPolicy = new java . util . ArrayList < CorsRule > ( corsPolicy ) ; |
public class Vector4d { /** * Rotate this vector the specified radians around the given rotation axis .
* @ param angle
* the angle in radians
* @ param x
* the x component of the rotation axis
* @ param y
* the y component of the rotation axis
* @ param z
* the z component of the rotation axis
* @ return a vector holding the result */
public Vector4d rotateAxis ( double angle , double x , double y , double z ) { } } | return rotateAxis ( angle , x , y , z , thisOrNew ( ) ) ; |
public class SVGUtil { /** * Add a CSS class to an Element .
* @ param e Element
* @ param cssclass class to add . */
public static void addCSSClass ( Element e , String cssclass ) { } } | String oldval = e . getAttribute ( SVGConstants . SVG_CLASS_ATTRIBUTE ) ; if ( oldval == null || oldval . length ( ) == 0 ) { setAtt ( e , SVGConstants . SVG_CLASS_ATTRIBUTE , cssclass ) ; return ; } String [ ] classes = oldval . split ( " " ) ; for ( String c : classes ) { if ( c . equals ( cssclass ) ) { return ; } } setAtt ( e , SVGConstants . SVG_CLASS_ATTRIBUTE , oldval + " " + cssclass ) ; |
public class CacheLoader { /** * Load data from the given iterator .
* @ param < T > type of data being loaded
* @ param i the iterator of data to load */
public < T > Future < ? > loadData ( Iterator < Map . Entry < String , T > > i ) { } } | Future < Boolean > mostRecent = null ; while ( i . hasNext ( ) ) { Map . Entry < String , T > e = i . next ( ) ; mostRecent = push ( e . getKey ( ) , e . getValue ( ) ) ; watch ( e . getKey ( ) , mostRecent ) ; } return mostRecent == null ? new ImmediateFuture ( true ) : mostRecent ; |
public class U { /** * Documented , # uniq */
public static < E > List < E > uniq ( final List < E > list ) { } } | return newArrayList ( newLinkedHashSet ( list ) ) ; |
public class DefaultEntityHandler { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . mapping . EntityHandler # doSelect ( jp . co . future . uroborosql . SqlAgent , jp . co . future . uroborosql . context . SqlContext , java . lang . Class ) */
@ Override public < E > Stream < E > doSelect ( final SqlAgent agent , final SqlContext context , final Class < ? extends E > entityType ) throws SQLException { } } | return agent . query ( context , new EntityResultSetConverter < > ( entityType , new PropertyMapperManager ( propertyMapperManager ) ) ) ; |
public class XBooleanLiteralImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case XbasePackage . XBOOLEAN_LITERAL__IS_TRUE : setIsTrue ( ( Boolean ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class CmsContainerPageCopier { /** * Produces the replacement for a container page element to use in a copy of an existing container page . < p >
* @ param targetPage the target container page
* @ param originalElement the original element
* @ return the replacement element for the copied page
* @ throws CmsException if something goes wrong
* @ throws NoCustomReplacementException if a custom replacement is not found for a type which requires it */
public CmsContainerElementBean replaceContainerElement ( CmsResource targetPage , CmsContainerElementBean originalElement ) throws CmsException , NoCustomReplacementException { } } | // if ( m _ elementReplacements . containsKey ( originalElement . getId ( )
CmsObject targetCms = OpenCms . initCmsObject ( m_cms ) ; CmsSite site = OpenCms . getSiteManager ( ) . getSiteForRootPath ( m_targetFolder . getRootPath ( ) ) ; if ( site != null ) { targetCms . getRequestContext ( ) . setSiteRoot ( site . getSiteRoot ( ) ) ; } if ( ( originalElement . getFormatterId ( ) == null ) || ( originalElement . getId ( ) == null ) ) { String rootPath = m_originalPage != null ? m_originalPage . getRootPath ( ) : "???" ; LOG . warn ( "Skipping container element because of missing id in page: " + rootPath ) ; return null ; } if ( m_elementReplacements . containsKey ( originalElement . getId ( ) ) ) { return new CmsContainerElementBean ( m_elementReplacements . get ( originalElement . getId ( ) ) , maybeReplaceFormatter ( originalElement . getFormatterId ( ) ) , maybeReplaceFormatterInSettings ( originalElement . getIndividualSettings ( ) ) , originalElement . isCreateNew ( ) ) ; } else { CmsResource originalResource = m_cms . readResource ( originalElement . getId ( ) , CmsResourceFilter . IGNORE_EXPIRATION ) ; I_CmsResourceType type = OpenCms . getResourceManager ( ) . getResourceType ( originalResource ) ; CmsADEConfigData config = OpenCms . getADEManager ( ) . lookupConfiguration ( m_cms , targetPage . getRootPath ( ) ) ; CmsResourceTypeConfig typeConfig = config . getResourceType ( type . getTypeName ( ) ) ; if ( ( m_copyMode != CopyMode . reuse ) && ( typeConfig != null ) && ( originalElement . isCreateNew ( ) || typeConfig . isCopyInModels ( ) ) && ! type . getTypeName ( ) . equals ( CmsResourceTypeXmlContainerPage . MODEL_GROUP_TYPE_NAME ) ) { CmsResource resourceCopy = typeConfig . createNewElement ( targetCms , originalResource , targetPage . getRootPath ( ) ) ; CmsContainerElementBean copy = new CmsContainerElementBean ( resourceCopy . getStructureId ( ) , maybeReplaceFormatter ( originalElement . getFormatterId ( ) ) , maybeReplaceFormatterInSettings ( originalElement . getIndividualSettings ( ) ) , originalElement . isCreateNew ( ) ) ; m_elementReplacements . put ( originalElement . getId ( ) , resourceCopy . getStructureId ( ) ) ; LOG . info ( "Copied container element " + originalResource . getRootPath ( ) + " -> " + resourceCopy . getRootPath ( ) ) ; CmsLockActionRecord record = null ; try { record = CmsLockUtil . ensureLock ( m_cms , resourceCopy ) ; adjustLocalesForElement ( resourceCopy ) ; } finally { if ( ( record != null ) && ( record . getChange ( ) == LockChange . locked ) ) { m_cms . unlockResource ( resourceCopy ) ; } } return copy ; } else if ( m_customReplacements != null ) { CmsUUID replacementId = m_customReplacements . get ( originalElement . getId ( ) ) ; if ( replacementId != null ) { return new CmsContainerElementBean ( replacementId , maybeReplaceFormatter ( originalElement . getFormatterId ( ) ) , maybeReplaceFormatterInSettings ( originalElement . getIndividualSettings ( ) ) , originalElement . isCreateNew ( ) ) ; } else { if ( ( m_typesWithRequiredReplacements != null ) && m_typesWithRequiredReplacements . contains ( type . getTypeName ( ) ) ) { throw new NoCustomReplacementException ( originalResource ) ; } else { return originalElement ; } } } else { LOG . info ( "Reusing container element: " + originalResource . getRootPath ( ) ) ; return originalElement ; } } |
public class CmsSiteManager { /** * Method to check if a folder under given path contains a bundle for macro resolving . < p >
* @ param cms CmsObject
* @ param folderPathRoot root path of folder
* @ return true if macros bundle found */
public static boolean isFolderWithMacros ( CmsObject cms , String folderPathRoot ) { } } | if ( ! CmsResource . isFolder ( folderPathRoot ) ) { folderPathRoot = folderPathRoot . concat ( "/" ) ; } try { cms . readResource ( folderPathRoot + MACRO_FOLDER ) ; cms . readResource ( folderPathRoot + MACRO_FOLDER + "/" + BUNDLE_NAME + "_desc" ) ; } catch ( CmsException e ) { return false ; } return true ; |
public class BuilderFactory { /** * Return an instance of the annotation type member builder for the given
* class .
* @ return an instance of the annotation type member builder for the given
* annotation type . */
public AbstractBuilder getAnnotationTypeRequiredMemberBuilder ( AnnotationTypeWriter annotationTypeWriter ) { } } | return AnnotationTypeRequiredMemberBuilder . getInstance ( context , annotationTypeWriter . getAnnotationTypeElement ( ) , writerFactory . getAnnotationTypeRequiredMemberWriter ( annotationTypeWriter ) ) ; |
public class KnowledgeExchangeHandler { /** * Gets a primitive boolean context property .
* @ param exchange the exchange
* @ param message the message
* @ param name the name
* @ return the property */
protected boolean isBoolean ( Exchange exchange , Message message , String name ) { } } | Boolean b = getBoolean ( exchange , message , name ) ; return b != null && b . booleanValue ( ) ; |
public class SegmentStatsRecorderImpl { /** * Method called with txn stats whenever a txn is committed .
* @ param streamSegmentName parent segment name
* @ param dataLength length of data written in txn
* @ param numOfEvents number of events written in txn
* @ param txnCreationTime time when txn was created */
@ Override public void merge ( String streamSegmentName , long dataLength , int numOfEvents , long txnCreationTime ) { } } | getDynamicLogger ( ) . incCounterValue ( SEGMENT_WRITE_BYTES , dataLength , segmentTags ( streamSegmentName ) ) ; getDynamicLogger ( ) . incCounterValue ( SEGMENT_WRITE_EVENTS , numOfEvents , segmentTags ( streamSegmentName ) ) ; SegmentAggregates aggregates = getSegmentAggregate ( streamSegmentName ) ; if ( aggregates != null && aggregates . updateTx ( dataLength , numOfEvents , txnCreationTime ) ) { report ( streamSegmentName , aggregates ) ; } |
public class LinkFieldUpdater { /** * Delete the inverse reference to the given target object ID . */
private void deleteLinkInverseValue ( String targetObjID ) { } } | int shardNo = m_tableDef . getShardNumber ( m_dbObj ) ; if ( shardNo > 0 && m_invLinkDef . isSharded ( ) ) { m_dbTran . deleteShardedLinkValue ( targetObjID , m_invLinkDef , m_dbObj . getObjectID ( ) , shardNo ) ; } else { m_dbTran . deleteLinkValue ( targetObjID , m_invLinkDef , m_dbObj . getObjectID ( ) ) ; } |
public class BundleStringJsonifier { /** * Creates a javascript object literal representing a set of message
* resources .
* @ return StringBuffer the object literal . */
public StringBuffer serializeBundles ( ) { } } | StringBuffer sb = new StringBuffer ( "{" ) ; // Iterates over the
for ( Iterator < String > it = keyMap . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String currentKey = it . next ( ) ; handleKey ( sb , keyMap , currentKey , currentKey , ! it . hasNext ( ) ) ; } return sb . append ( "}" ) ; |
public class BOGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setOEGName ( String newOEGName ) { } } | String oldOEGName = oegName ; oegName = newOEGName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . BOG__OEG_NAME , oldOEGName , oegName ) ) ; |
public class KeyVaultClientBaseImpl { /** * Gets the specified deleted storage account .
* The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes . This operation requires the storage / get permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param storageAccountName The name of the storage account .
* @ 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 < DeletedStorageBundle > getDeletedStorageAccountAsync ( String vaultBaseUrl , String storageAccountName , final ServiceCallback < DeletedStorageBundle > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getDeletedStorageAccountWithServiceResponseAsync ( vaultBaseUrl , storageAccountName ) , serviceCallback ) ; |
public class Instants { /** * Creates an Instant , input format is " yyyy - MM - dd ' T ' HH : mm : ss [ . SSS ] ' Z ' " , timezone is UTC . */
public static Instant instantUtc ( String text ) { } } | Instant result = null ; try { ZonedDateTime zdt = ZonedDateTime . parse ( text , getFormater ( DATE_FORMAT_UTC , "UTC" ) ) ; // LocalDateTime ldt = LocalDateTime . parse ( text , getFormater ( DATE _ FORMAT _ UTC , " UTC " ) ) ;
result = zdt . toInstant ( ) ; } catch ( DateTimeParseException ex ) { Say . warn ( "Instant not constructable {}" , ex , text ) ; } return result ; |
public class BeanUtils { /** * Return the value of the specified property of the specified bean , no matter which property
* reference format is used , as a String .
* For more details see < code > BeanUtilsBean < / code > .
* @ param pbean Bean whose property is to be extracted
* @ param pname Possibly indexed and / or nested name of the property to be extracted
* @ return The property ' s value , converted to a String
* @ exception IllegalAccessException if the caller does not have access to the property accessor
* method
* @ exception InvocationTargetException if the property accessor method throws an exception
* @ exception NoSuchMethodException if an accessor method for this property cannot be found */
public static String getProperty ( final Object pbean , final String pname ) throws IllegalAccessException , InvocationTargetException , NoSuchMethodException { } } | return Objects . toString ( PropertyUtils . getProperty ( pbean , pname ) , null ) ; |
public class CharsetUtils { /** * Get the actual string value declared as the charset in a content - type
* string , regardless of its validity .
* NOTE : this is different from getCharset , which will always return a
* default value .
* @ param contentType
* the content - type string
* @ return the verbatim charset declared or null if non - exists */
public static String getDeclaredCharset ( String contentType ) { } } | if ( contentType == null ) { return null ; } Matcher matcher = CHARSET_PATT . matcher ( contentType ) ; if ( matcher . find ( ) ) { String encstr = matcher . group ( 1 ) ; return encstr ; } else { return null ; } |
public class GoogleCloudStorageMergeOutput { /** * Returns a writer that writes the data the same way that the sort does , splitting the output
* every time the key goes backwards in sequence . This way the output is a collection of files
* that are individually fully sorted . This works in conjunction with
* { @ link GoogleCloudStorageMergeInput } to convert a large number of sorted files into a much
* smaller number of sorted files . */
@ Override public List < ? extends OutputWriter < KeyValue < ByteBuffer , List < ByteBuffer > > > > createWriters ( int shards ) { } } | ImmutableList . Builder < OutputWriter < KeyValue < ByteBuffer , List < ByteBuffer > > > > result = new ImmutableList . Builder < > ( ) ; for ( int i = 0 ; i < shards ; i ++ ) { result . add ( new OrderSlicingOutputWriter ( bucket , String . format ( MapReduceConstants . MERGE_OUTPUT_DIR_FORMAT , mrJobId , tier , i ) ) ) ; } return result . build ( ) ; |
public class IndexDocumentsResult { /** * The names of the fields that are currently being indexed .
* @ param fieldNames
* The names of the fields that are currently being indexed . */
public void setFieldNames ( java . util . Collection < String > fieldNames ) { } } | if ( fieldNames == null ) { this . fieldNames = null ; return ; } this . fieldNames = new com . amazonaws . internal . SdkInternalList < String > ( fieldNames ) ; |
public class NtlmPasswordAuthenticator { /** * Calculates the effective user session key .
* @ param tc
* context to use
* @ param chlng
* The server challenge .
* @ param dest
* The destination array in which the user session key will be
* placed .
* @ param offset
* The offset in the destination array at which the
* session key will start .
* @ throws SmbException */
public void getUserSessionKey ( CIFSContext tc , byte [ ] chlng , byte [ ] dest , int offset ) throws SmbException { } } | try { MessageDigest md4 = Crypto . getMD4 ( ) ; md4 . update ( Strings . getUNIBytes ( this . password ) ) ; switch ( tc . getConfig ( ) . getLanManCompatibility ( ) ) { case 0 : case 1 : case 2 : md4 . update ( md4 . digest ( ) ) ; md4 . digest ( dest , offset , 16 ) ; break ; case 3 : case 4 : case 5 : synchronized ( this ) { if ( this . clientChallenge == null ) { this . clientChallenge = new byte [ 8 ] ; tc . getConfig ( ) . getRandom ( ) . nextBytes ( this . clientChallenge ) ; } } MessageDigest hmac = Crypto . getHMACT64 ( md4 . digest ( ) ) ; hmac . update ( Strings . getUNIBytes ( this . username . toUpperCase ( ) ) ) ; hmac . update ( Strings . getUNIBytes ( this . domain . toUpperCase ( ) ) ) ; byte [ ] ntlmv2Hash = hmac . digest ( ) ; hmac = Crypto . getHMACT64 ( ntlmv2Hash ) ; hmac . update ( chlng ) ; hmac . update ( this . clientChallenge ) ; MessageDigest userKey = Crypto . getHMACT64 ( ntlmv2Hash ) ; userKey . update ( hmac . digest ( ) ) ; userKey . digest ( dest , offset , 16 ) ; break ; default : md4 . update ( md4 . digest ( ) ) ; md4 . digest ( dest , offset , 16 ) ; break ; } } catch ( Exception e ) { throw new SmbException ( "" , e ) ; } |
public class NodeObject { /** * Requests that the < code > locks < / code > field be set to the
* specified value . Generally one only adds , updates and removes
* entries of a distributed set , but certain situations call for a
* complete replacement of the set value . The local value will be
* updated immediately and an event will be propagated through the
* system to notify all listeners that the attribute did
* change . Proxied copies of this object ( on clients ) will apply the
* value change when they received the attribute changed notification . */
@ Generated ( value = { } } | "com.threerings.presents.tools.GenDObjectTask" } ) public void setLocks ( DSet < NodeObject . Lock > value ) { requestAttributeChange ( LOCKS , value , this . locks ) ; DSet < NodeObject . Lock > clone = ( value == null ) ? null : value . clone ( ) ; this . locks = clone ; |
public class WindowsFaxClientSpiHelper { /** * This function returns the fax job ID ( if valid ) .
* If fax job ID is not valid , an error will be thrown .
* @ param faxJob
* The fax job object
* @ return The fax job ID */
public static int getFaxJobID ( FaxJob faxJob ) { } } | if ( faxJob == null ) { throw new FaxException ( "Fax job not provided." ) ; } // get fax job ID
String faxJobID = faxJob . getID ( ) ; WindowsFaxClientSpiHelper . validateFaxJobID ( faxJobID ) ; int faxJobIDInt = Integer . parseInt ( faxJobID ) ; return faxJobIDInt ; |
public class DOMUtils { /** * Create an Element for a given QName .
* This uses the document builder associated with the current thread . */
public static Element createElement ( QName qname ) { } } | return createElement ( qname . getLocalPart ( ) , qname . getPrefix ( ) , qname . getNamespaceURI ( ) ) ; |
public class Annotation { /** * Returns the title of this < CODE > Annotation < / CODE > .
* @ return a name */
public String title ( ) { } } | String s = ( String ) annotationAttributes . get ( TITLE ) ; if ( s == null ) s = "" ; return s ; |
public class GetQueueRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetQueueRequest getQueueRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getQueueRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getQueueRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ClusterJoinManager { /** * Validate that the configuration received from the remote node in { @ code joinMessage } is compatible with the
* configuration of this node .
* @ param joinMessage the { @ link JoinMessage } received from another node .
* @ return { @ code true } if packet version of join message matches this node ' s packet version and configurations
* are found to be compatible , otherwise { @ code false } .
* @ throws Exception in case any exception occurred while checking compatibilty
* @ see ConfigCheck */
public boolean validateJoinMessage ( JoinMessage joinMessage ) { } } | if ( joinMessage . getPacketVersion ( ) != Packet . VERSION ) { return false ; } try { ConfigCheck newMemberConfigCheck = joinMessage . getConfigCheck ( ) ; ConfigCheck clusterConfigCheck = node . createConfigCheck ( ) ; return clusterConfigCheck . isCompatible ( newMemberConfigCheck ) ; } catch ( Exception e ) { logger . warning ( format ( "Invalid join request from %s, cause: %s" , joinMessage . getAddress ( ) , e . getMessage ( ) ) ) ; throw e ; } |
public class Collections2 { /** * An implementation of { @ link Collection # toString ( ) } . */
static String toStringImpl ( final Collection < ? > collection ) { } } | StringBuilder sb = newStringBuilderForCollection ( collection . size ( ) ) . append ( '[' ) ; STANDARD_JOINER . appendTo ( sb , Iterables . transform ( collection , new Function < Object , Object > ( ) { @ Override public Object apply ( Object input ) { return input == collection ? "(this Collection)" : input ; } } ) ) ; return sb . append ( ']' ) . toString ( ) ; |
public class Base64Encoder { /** * Translates the specified Base64 string into a byte array .
* @ param data the Base64 string ( not null )
* @ return the byte array ( not null )
* @ throws CoderException */
public static byte [ ] decode ( String data ) { } } | // TODO : when we move to Java 8 change to
// https : / / docs . oracle . com / javase / 8 / docs / api / java / util / Base64 . Decoder . html
return org . apache . commons . codec . binary . Base64 . decodeBase64 ( data ) ; |
public class LottieDrawable { /** * Plays the animation from the beginning . If speed is < 0 , it will start at the end
* and play towards the beginning */
@ MainThread public void playAnimation ( ) { } } | if ( compositionLayer == null ) { lazyCompositionTasks . add ( new LazyCompositionTask ( ) { @ Override public void run ( LottieComposition composition ) { playAnimation ( ) ; } } ) ; return ; } if ( systemAnimationsEnabled || getRepeatCount ( ) == 0 ) { animator . playAnimation ( ) ; } if ( ! systemAnimationsEnabled ) { setFrame ( ( int ) ( getSpeed ( ) < 0 ? getMinFrame ( ) : getMaxFrame ( ) ) ) ; } |
public class AbstractInterfaceConfig { /** * 接口属性和方法属性加载配置到缓存
* @ param rebuild 是否重建
* @ return Map < String Object > unmodifiableMap */
public synchronized Map < String , Object > getConfigValueCache ( boolean rebuild ) { } } | if ( configValueCache != null && ! rebuild ) { return configValueCache ; } Map < String , Object > context = new HashMap < String , Object > ( 32 ) ; Map < String , String > providerParams = getParameters ( ) ; if ( providerParams != null ) { context . putAll ( providerParams ) ; // 复制接口的自定义参数
} Map < String , MethodConfig > methodConfigs = getMethods ( ) ; if ( CommonUtils . isNotEmpty ( methodConfigs ) ) { for ( MethodConfig methodConfig : methodConfigs . values ( ) ) { String prefix = RpcConstants . HIDE_KEY_PREFIX + methodConfig . getName ( ) + RpcConstants . HIDE_KEY_PREFIX ; Map < String , String > methodparam = methodConfig . getParameters ( ) ; if ( methodparam != null ) { // 复制方法级自定义参数
for ( Map . Entry < String , String > entry : methodparam . entrySet ( ) ) { context . put ( prefix + entry . getKey ( ) , entry . getValue ( ) ) ; } } // 复制方法级参数属性
BeanUtils . copyPropertiesToMap ( methodConfig , prefix , context ) ; } } // 复制接口级参数属性
BeanUtils . copyPropertiesToMap ( this , StringUtils . EMPTY , context ) ; configValueCache = Collections . unmodifiableMap ( context ) ; return configValueCache ; |
public class BoxApiMetadata { /** * Gets a request that adds metadata to a folder
* @ param id id of the folder to add metadata to
* @ param values mapping of the template keys to their values
* @ param scope currently only global and enterprise scopes are supported
* @ param template metadata template to use
* @ return request to add metadata to a folder */
public BoxRequestsMetadata . AddItemMetadata getAddFolderMetadataRequest ( String id , LinkedHashMap < String , Object > values , String scope , String template ) { } } | BoxRequestsMetadata . AddItemMetadata request = new BoxRequestsMetadata . AddItemMetadata ( values , getFolderMetadataUrl ( id , scope , template ) , mSession ) ; return request ; |
public class MutableInterval { /** * Sets the end of this time interval as an Instant .
* @ param end the end of the time interval , null means now
* @ throws IllegalArgumentException if the end is before the start */
public void setEnd ( ReadableInstant end ) { } } | long endMillis = DateTimeUtils . getInstantMillis ( end ) ; super . setInterval ( getStartMillis ( ) , endMillis , getChronology ( ) ) ; |
public class SimpleRasterizer { /** * Call before starting the edges .
* For example to render two polygons that consist of a single ring :
* startAddingEdges ( ) ;
* addRing ( . . . ) ;
* renderEdges ( Rasterizer . EVEN _ ODD ) ;
* addRing ( . . . ) ;
* renderEdges ( Rasterizer . EVEN _ ODD ) ;
* For example to render a polygon consisting of three rings :
* startAddingEdges ( ) ;
* addRing ( . . . ) ;
* addRing ( . . . ) ;
* addRing ( . . . ) ;
* renderEdges ( Rasterizer . EVEN _ ODD ) ; */
public final void startAddingEdges ( ) { } } | if ( numEdges_ > 0 ) { for ( int i = 0 ; i < height_ ; i ++ ) { for ( Edge e = ySortedEdges_ [ i ] ; e != null ; ) { Edge p = e ; e = e . next ; p . next = null ; } ySortedEdges_ [ i ] = null ; } activeEdgesTable_ = null ; } minY_ = height_ ; maxY_ = - 1 ; numEdges_ = 0 ; |
public class Validate { /** * < p > Validates that the index is within the bounds of the argument
* character sequence ; otherwise throwing an exception . < / p >
* < pre > Validate . validIndex ( myStr , 2 ) ; < / pre >
* < p > If the character sequence is { @ code null } , then the message
* of the exception is & quot ; The validated object is
* null & quot ; . < / p >
* < p > If the index is invalid , then the message of the exception
* is & quot ; The validated character sequence index is invalid : & quot ;
* followed by the index . < / p >
* @ param < T > the character sequence type
* @ param chars the character sequence to check , validated not null by this method
* @ param index the index to check
* @ return the validated character sequence ( never { @ code null } for method chaining )
* @ throws NullPointerException if the character sequence is { @ code null }
* @ throws IndexOutOfBoundsException if the index is invalid
* @ see # validIndex ( CharSequence , int , String , Object . . . )
* @ since 3.0 */
public static < T extends CharSequence > T validIndex ( final T chars , final int index ) { } } | return validIndex ( chars , index , DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EX_MESSAGE , Integer . valueOf ( index ) ) ; |
public class ServerBuilder { /** * Sets the { @ link Executor } dedicated to the execution of blocking tasks or invocations .
* If not set , { @ linkplain CommonPools # blockingTaskExecutor ( ) the common pool } is used .
* @ param shutdownOnStop whether to shut down the { @ link Executor } when the { @ link Server } stops */
public ServerBuilder blockingTaskExecutor ( Executor blockingTaskExecutor , boolean shutdownOnStop ) { } } | this . blockingTaskExecutor = requireNonNull ( blockingTaskExecutor , "blockingTaskExecutor" ) ; shutdownBlockingTaskExecutorOnStop = shutdownOnStop ; return this ; |
public class JarWithFile { /** * Returns the last - modified time of the entry in the jar file .
* @ param path full path to the jar entry
* @ return the length of the entry */
public long getLastModified ( String path ) { } } | try { // this entry time can cause problems . . .
ZipEntry entry = getZipEntry ( path ) ; return entry != null ? entry . getTime ( ) : - 1 ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } return - 1 ; |
public class SpecializedOps_DDRM { /** * Sums up the square of each element in the matrix . This is equivalent to the
* Frobenius norm squared .
* @ param m Matrix .
* @ return Sum of elements squared . */
public static double elementSumSq ( DMatrixD1 m ) { } } | // minimize round off error
double maxAbs = CommonOps_DDRM . elementMaxAbs ( m ) ; if ( maxAbs == 0 ) return 0 ; double total = 0 ; int N = m . getNumElements ( ) ; for ( int i = 0 ; i < N ; i ++ ) { double d = m . data [ i ] / maxAbs ; total += d * d ; } return maxAbs * total * maxAbs ; |
public class JsonUtil { /** * Returns a field in a Json object as a double .
* @ param object the Json Object
* @ param field the field in the Json object to return
* @ param defaultValue a default value for the field if the field value is null
* @ return the Json field value as a double */
public static double getDouble ( JsonObject object , String field , double defaultValue ) { } } | final JsonValue value = object . get ( field ) ; if ( value == null || value . isNull ( ) ) { return defaultValue ; } else { return value . asDouble ( ) ; } |
public class LinearSearch { /** * Search for the value in the array and return the index of the first occurrence from the
* beginning of the array .
* @ param < E > the type of elements in this array .
* @ param array array that we are searching in .
* @ param value value that is being searched in the array .
* @ return the index where the value is found in the array , else - 1. */
public static < E > int search ( E [ ] array , E value ) { } } | return LinearSearch . search ( array , value , 1 ) ; |
public class AbstractMemberPropertyAccessor { /** * Return any accessor , be it read or write , for the given property .
* @ param propertyName name of the property .
* @ return an accessor for the property or < code > null < / code > */
protected Member getPropertyAccessor ( String propertyName ) { } } | if ( readAccessors . containsKey ( propertyName ) ) { return ( Member ) readAccessors . get ( propertyName ) ; } else { return ( Member ) writeAccessors . get ( propertyName ) ; } |
public class TextAnalysis { /** * Combine string .
* @ param left the left
* @ param right the right
* @ param minOverlap the min overlap
* @ return the string */
public static String combine ( String left , String right , int minOverlap ) { } } | if ( left . length ( ) < minOverlap ) return null ; if ( right . length ( ) < minOverlap ) return null ; int bestOffset = Integer . MAX_VALUE ; for ( int offset = minOverlap - left . length ( ) ; offset < right . length ( ) - minOverlap ; offset ++ ) { boolean match = true ; for ( int posLeft = Math . max ( 0 , - offset ) ; posLeft < Math . min ( left . length ( ) , right . length ( ) - offset ) ; posLeft ++ ) { if ( left . charAt ( posLeft ) != right . charAt ( posLeft + offset ) ) { match = false ; break ; } } if ( match ) { if ( Math . abs ( bestOffset ) > Math . abs ( offset ) ) bestOffset = offset ; } } if ( bestOffset < Integer . MAX_VALUE ) { String combined = left ; if ( bestOffset > 0 ) { combined = right . substring ( 0 , bestOffset ) + combined ; } if ( left . length ( ) + bestOffset < right . length ( ) ) { combined = combined + right . substring ( left . length ( ) + bestOffset ) ; } return combined ; } else { return null ; } |
public class LoggingClientInterceptor { /** * Builds response content string from response object .
* @ param response
* @ return
* @ throws IOException */
private String getResponseContent ( CachingClientHttpResponseWrapper response ) throws IOException { } } | if ( response != null ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "HTTP/1.1 " ) ; // TODO get Http version from message
builder . append ( response . getStatusCode ( ) ) ; builder . append ( " " ) ; builder . append ( response . getStatusText ( ) ) ; builder . append ( NEWLINE ) ; appendHeaders ( response . getHeaders ( ) , builder ) ; builder . append ( NEWLINE ) ; builder . append ( response . getBodyContent ( ) ) ; return builder . toString ( ) ; } else { return "" ; } |
public class PAbstractObject { /** * Get a property as a array or default .
* @ param key the property name
* @ param defaultValue default */
@ Override public final PArray optArray ( final String key , final PArray defaultValue ) { } } | PArray result = optArray ( key ) ; return result == null ? defaultValue : result ; |
public class ComputeNodesImpl { /** * Gets the settings required for remote login to a compute node .
* Before you can remotely login to a node using the remote login settings , you must create a user account on the node . This API can be invoked only on pools created with the virtual machine configuration property . For pools created with a cloud service configuration , see the GetRemoteDesktop API .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node for which to obtain the remote login settings .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ComputeNodeGetRemoteLoginSettingsResult object */
public Observable < ComputeNodeGetRemoteLoginSettingsResult > getRemoteLoginSettingsAsync ( String poolId , String nodeId ) { } } | return getRemoteLoginSettingsWithServiceResponseAsync ( poolId , nodeId ) . map ( new Func1 < ServiceResponseWithHeaders < ComputeNodeGetRemoteLoginSettingsResult , ComputeNodeGetRemoteLoginSettingsHeaders > , ComputeNodeGetRemoteLoginSettingsResult > ( ) { @ Override public ComputeNodeGetRemoteLoginSettingsResult call ( ServiceResponseWithHeaders < ComputeNodeGetRemoteLoginSettingsResult , ComputeNodeGetRemoteLoginSettingsHeaders > response ) { return response . body ( ) ; } } ) ; |
public class fannkuch { /** * next _ perm ( ' 1234 ' , 2 ) - > ' 2314' */
private static final void next_perm ( final int [ ] permutation , int position ) { } } | int perm0 = permutation [ 0 ] ; for ( int i = 0 ; i < position ; ++ i ) permutation [ i ] = permutation [ i + 1 ] ; permutation [ position ] = perm0 ; |
public class GherkinExtensionRegistry { /** * ( non - Javadoc )
* @ see
* org . asciidoctor . extension . spi . ExtensionRegistry # register ( org . asciidoctor
* . Asciidoctor ) */
@ Override public void register ( Asciidoctor asciidoctor ) { } } | RubyExtensionRegistry rubyExtensionRegistry = asciidoctor . rubyExtensionRegistry ( ) ; rubyExtensionRegistry . loadClass ( this . getClass ( ) . getResourceAsStream ( "gherkinblockmacro.rb" ) ) . blockMacro ( "gherkin" , "GherkinBlockMacroProcessor" ) ; |
public class CreativeServiceLocator { /** * For the given interface , get the stub implementation .
* If this service has no port for the given interface ,
* then ServiceException is thrown . */
public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } } | try { if ( com . google . api . ads . admanager . axis . v201811 . CreativeServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201811 . CreativeServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201811 . CreativeServiceSoapBindingStub ( new java . net . URL ( CreativeServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getCreativeServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ; |
public class hqlLexer { /** * $ ANTLR start " NUM _ INT " */
public final void mNUM_INT ( ) throws RecognitionException { } } | try { int _type = NUM_INT ; int _channel = DEFAULT_TOKEN_CHANNEL ; CommonToken f1 = null ; CommonToken f2 = null ; CommonToken f3 = null ; CommonToken f4 = null ; boolean isDecimal = false ; Token t = null ; // hql . g : 804:2 : ( ' . ' ( ( ' 0 ' . . ' 9 ' ) + ( EXPONENT ) ? ( f1 = FLOAT _ SUFFIX ) ? ) ? | ( ' 0 ' ( ( ' x ' ) ( HEX _ DIGIT ) + | ( ' 0 ' . . ' 7 ' ) + ) ? | ( ' 1 ' . . ' 9 ' ) ( ' 0 ' . . ' 9 ' ) * ) ( ( ' l ' ) | { . . . } ? ( ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ? | EXPONENT ( f3 = FLOAT _ SUFFIX ) ? | f4 = FLOAT _ SUFFIX ) ) ? )
int alt20 = 2 ; int LA20_0 = input . LA ( 1 ) ; if ( ( LA20_0 == '.' ) ) { alt20 = 1 ; } else if ( ( ( LA20_0 >= '0' && LA20_0 <= '9' ) ) ) { alt20 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 20 , 0 , input ) ; throw nvae ; } switch ( alt20 ) { case 1 : // hql . g : 804:6 : ' . ' ( ( ' 0 ' . . ' 9 ' ) + ( EXPONENT ) ? ( f1 = FLOAT _ SUFFIX ) ? ) ?
{ match ( '.' ) ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { _type = DOT ; } // hql . g : 805:4 : ( ( ' 0 ' . . ' 9 ' ) + ( EXPONENT ) ? ( f1 = FLOAT _ SUFFIX ) ? ) ?
int alt8 = 2 ; int LA8_0 = input . LA ( 1 ) ; if ( ( ( LA8_0 >= '0' && LA8_0 <= '9' ) ) ) { alt8 = 1 ; } switch ( alt8 ) { case 1 : // hql . g : 805:6 : ( ' 0 ' . . ' 9 ' ) + ( EXPONENT ) ? ( f1 = FLOAT _ SUFFIX ) ?
{ // hql . g : 805:6 : ( ' 0 ' . . ' 9 ' ) +
int cnt5 = 0 ; loop5 : while ( true ) { int alt5 = 2 ; int LA5_0 = input . LA ( 1 ) ; if ( ( ( LA5_0 >= '0' && LA5_0 <= '9' ) ) ) { alt5 = 1 ; } switch ( alt5 ) { case 1 : // hql . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt5 >= 1 ) break loop5 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 5 , input ) ; throw eee ; } cnt5 ++ ; } // hql . g : 805:18 : ( EXPONENT ) ?
int alt6 = 2 ; int LA6_0 = input . LA ( 1 ) ; if ( ( LA6_0 == 'e' ) ) { alt6 = 1 ; } switch ( alt6 ) { case 1 : // hql . g : 805:19 : EXPONENT
{ mEXPONENT ( ) ; if ( state . failed ) return ; } break ; } // hql . g : 805:30 : ( f1 = FLOAT _ SUFFIX ) ?
int alt7 = 2 ; int LA7_0 = input . LA ( 1 ) ; if ( ( LA7_0 == 'd' || LA7_0 == 'f' || LA7_0 == 'm' ) ) { alt7 = 1 ; } switch ( alt7 ) { case 1 : // hql . g : 805:31 : f1 = FLOAT _ SUFFIX
{ int f1Start986 = getCharIndex ( ) ; int f1StartLine986 = getLine ( ) ; int f1StartCharPos986 = getCharPositionInLine ( ) ; mFLOAT_SUFFIX ( ) ; if ( state . failed ) return ; f1 = new CommonToken ( input , Token . INVALID_TOKEN_TYPE , Token . DEFAULT_CHANNEL , f1Start986 , getCharIndex ( ) - 1 ) ; f1 . setLine ( f1StartLine986 ) ; f1 . setCharPositionInLine ( f1StartCharPos986 ) ; if ( state . backtracking == 0 ) { t = f1 ; } } break ; } if ( state . backtracking == 0 ) { if ( t != null && t . getText ( ) . toUpperCase ( ) . indexOf ( 'F' ) >= 0 ) { _type = NUM_FLOAT ; } else if ( t != null && t . getText ( ) . toUpperCase ( ) . indexOf ( 'M' ) >= 0 ) { _type = NUM_DECIMAL ; } else { _type = NUM_DOUBLE ; // assume double
} } } break ; } } break ; case 2 : // hql . g : 821:4 : ( ' 0 ' ( ( ' x ' ) ( HEX _ DIGIT ) + | ( ' 0 ' . . ' 7 ' ) + ) ? | ( ' 1 ' . . ' 9 ' ) ( ' 0 ' . . ' 9 ' ) * ) ( ( ' l ' ) | { . . . } ? ( ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ? | EXPONENT ( f3 = FLOAT _ SUFFIX ) ? | f4 = FLOAT _ SUFFIX ) ) ?
{ // hql . g : 821:4 : ( ' 0 ' ( ( ' x ' ) ( HEX _ DIGIT ) + | ( ' 0 ' . . ' 7 ' ) + ) ? | ( ' 1 ' . . ' 9 ' ) ( ' 0 ' . . ' 9 ' ) * )
int alt13 = 2 ; int LA13_0 = input . LA ( 1 ) ; if ( ( LA13_0 == '0' ) ) { alt13 = 1 ; } else if ( ( ( LA13_0 >= '1' && LA13_0 <= '9' ) ) ) { alt13 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 13 , 0 , input ) ; throw nvae ; } switch ( alt13 ) { case 1 : // hql . g : 821:6 : ' 0 ' ( ( ' x ' ) ( HEX _ DIGIT ) + | ( ' 0 ' . . ' 7 ' ) + ) ?
{ match ( '0' ) ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { isDecimal = true ; } // hql . g : 822:4 : ( ( ' x ' ) ( HEX _ DIGIT ) + | ( ' 0 ' . . ' 7 ' ) + ) ?
int alt11 = 3 ; int LA11_0 = input . LA ( 1 ) ; if ( ( LA11_0 == 'x' ) ) { alt11 = 1 ; } else if ( ( ( LA11_0 >= '0' && LA11_0 <= '7' ) ) ) { alt11 = 2 ; } switch ( alt11 ) { case 1 : // hql . g : 822:6 : ( ' x ' ) ( HEX _ DIGIT ) +
{ // hql . g : 822:6 : ( ' x ' )
// hql . g : 822:7 : ' x '
{ match ( 'x' ) ; if ( state . failed ) return ; } // hql . g : 823:5 : ( HEX _ DIGIT ) +
int cnt9 = 0 ; loop9 : while ( true ) { int alt9 = 2 ; switch ( input . LA ( 1 ) ) { case 'e' : { int LA9_2 = input . LA ( 2 ) ; if ( ( ( LA9_2 >= '0' && LA9_2 <= '9' ) ) ) { int LA9_5 = input . LA ( 3 ) ; if ( ( ! ( ( ( isDecimal ) ) ) ) ) { alt9 = 1 ; } } else { alt9 = 1 ; } } break ; case 'd' : case 'f' : { int LA9_3 = input . LA ( 2 ) ; if ( ( ! ( ( ( isDecimal ) ) ) ) ) { alt9 = 1 ; } } break ; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case 'a' : case 'b' : case 'c' : { alt9 = 1 ; } break ; } switch ( alt9 ) { case 1 : // hql . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) || ( input . LA ( 1 ) >= 'a' && input . LA ( 1 ) <= 'f' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt9 >= 1 ) break loop9 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 9 , input ) ; throw eee ; } cnt9 ++ ; } } break ; case 2 : // hql . g : 832:6 : ( ' 0 ' . . ' 7 ' ) +
{ // hql . g : 832:6 : ( ' 0 ' . . ' 7 ' ) +
int cnt10 = 0 ; loop10 : while ( true ) { int alt10 = 2 ; int LA10_0 = input . LA ( 1 ) ; if ( ( ( LA10_0 >= '0' && LA10_0 <= '7' ) ) ) { alt10 = 1 ; } switch ( alt10 ) { case 1 : // hql . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt10 >= 1 ) break loop10 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 10 , input ) ; throw eee ; } cnt10 ++ ; } } break ; } } break ; case 2 : // hql . g : 834:5 : ( ' 1 ' . . ' 9 ' ) ( ' 0 ' . . ' 9 ' ) *
{ if ( ( input . LA ( 1 ) >= '1' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } // hql . g : 834:16 : ( ' 0 ' . . ' 9 ' ) *
loop12 : while ( true ) { int alt12 = 2 ; int LA12_0 = input . LA ( 1 ) ; if ( ( ( LA12_0 >= '0' && LA12_0 <= '9' ) ) ) { alt12 = 1 ; } switch ( alt12 ) { case 1 : // hql . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop12 ; } } if ( state . backtracking == 0 ) { isDecimal = true ; } } break ; } // hql . g : 836:3 : ( ( ' l ' ) | { . . . } ? ( ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ? | EXPONENT ( f3 = FLOAT _ SUFFIX ) ? | f4 = FLOAT _ SUFFIX ) ) ?
int alt19 = 3 ; int LA19_0 = input . LA ( 1 ) ; if ( ( LA19_0 == 'l' ) ) { alt19 = 1 ; } else if ( ( LA19_0 == '.' || ( LA19_0 >= 'd' && LA19_0 <= 'f' ) || LA19_0 == 'm' ) ) { alt19 = 2 ; } switch ( alt19 ) { case 1 : // hql . g : 836:5 : ( ' l ' )
{ // hql . g : 836:5 : ( ' l ' )
// hql . g : 836:6 : ' l '
{ match ( 'l' ) ; if ( state . failed ) return ; } if ( state . backtracking == 0 ) { _type = NUM_LONG ; } } break ; case 2 : // hql . g : 839:5 : { . . . } ? ( ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ? | EXPONENT ( f3 = FLOAT _ SUFFIX ) ? | f4 = FLOAT _ SUFFIX )
{ if ( ! ( ( isDecimal ) ) ) { if ( state . backtracking > 0 ) { state . failed = true ; return ; } throw new FailedPredicateException ( input , "NUM_INT" , "isDecimal" ) ; } // hql . g : 840:4 : ( ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ? | EXPONENT ( f3 = FLOAT _ SUFFIX ) ? | f4 = FLOAT _ SUFFIX )
int alt18 = 3 ; switch ( input . LA ( 1 ) ) { case '.' : { alt18 = 1 ; } break ; case 'e' : { alt18 = 2 ; } break ; case 'd' : case 'f' : case 'm' : { alt18 = 3 ; } break ; default : if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 18 , 0 , input ) ; throw nvae ; } switch ( alt18 ) { case 1 : // hql . g : 840:8 : ' . ' ( ' 0 ' . . ' 9 ' ) * ( EXPONENT ) ? ( f2 = FLOAT _ SUFFIX ) ?
{ match ( '.' ) ; if ( state . failed ) return ; // hql . g : 840:12 : ( ' 0 ' . . ' 9 ' ) *
loop14 : while ( true ) { int alt14 = 2 ; int LA14_0 = input . LA ( 1 ) ; if ( ( ( LA14_0 >= '0' && LA14_0 <= '9' ) ) ) { alt14 = 1 ; } switch ( alt14 ) { case 1 : // hql . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop14 ; } } // hql . g : 840:24 : ( EXPONENT ) ?
int alt15 = 2 ; int LA15_0 = input . LA ( 1 ) ; if ( ( LA15_0 == 'e' ) ) { alt15 = 1 ; } switch ( alt15 ) { case 1 : // hql . g : 840:25 : EXPONENT
{ mEXPONENT ( ) ; if ( state . failed ) return ; } break ; } // hql . g : 840:36 : ( f2 = FLOAT _ SUFFIX ) ?
int alt16 = 2 ; int LA16_0 = input . LA ( 1 ) ; if ( ( LA16_0 == 'd' || LA16_0 == 'f' || LA16_0 == 'm' ) ) { alt16 = 1 ; } switch ( alt16 ) { case 1 : // hql . g : 840:37 : f2 = FLOAT _ SUFFIX
{ int f2Start1188 = getCharIndex ( ) ; int f2StartLine1188 = getLine ( ) ; int f2StartCharPos1188 = getCharPositionInLine ( ) ; mFLOAT_SUFFIX ( ) ; if ( state . failed ) return ; f2 = new CommonToken ( input , Token . INVALID_TOKEN_TYPE , Token . DEFAULT_CHANNEL , f2Start1188 , getCharIndex ( ) - 1 ) ; f2 . setLine ( f2StartLine1188 ) ; f2 . setCharPositionInLine ( f2StartCharPos1188 ) ; if ( state . backtracking == 0 ) { t = f2 ; } } break ; } } break ; case 2 : // hql . g : 841:8 : EXPONENT ( f3 = FLOAT _ SUFFIX ) ?
{ mEXPONENT ( ) ; if ( state . failed ) return ; // hql . g : 841:17 : ( f3 = FLOAT _ SUFFIX ) ?
int alt17 = 2 ; int LA17_0 = input . LA ( 1 ) ; if ( ( LA17_0 == 'd' || LA17_0 == 'f' || LA17_0 == 'm' ) ) { alt17 = 1 ; } switch ( alt17 ) { case 1 : // hql . g : 841:18 : f3 = FLOAT _ SUFFIX
{ int f3Start1206 = getCharIndex ( ) ; int f3StartLine1206 = getLine ( ) ; int f3StartCharPos1206 = getCharPositionInLine ( ) ; mFLOAT_SUFFIX ( ) ; if ( state . failed ) return ; f3 = new CommonToken ( input , Token . INVALID_TOKEN_TYPE , Token . DEFAULT_CHANNEL , f3Start1206 , getCharIndex ( ) - 1 ) ; f3 . setLine ( f3StartLine1206 ) ; f3 . setCharPositionInLine ( f3StartCharPos1206 ) ; if ( state . backtracking == 0 ) { t = f3 ; } } break ; } } break ; case 3 : // hql . g : 842:8 : f4 = FLOAT _ SUFFIX
{ int f4Start1221 = getCharIndex ( ) ; int f4StartLine1221 = getLine ( ) ; int f4StartCharPos1221 = getCharPositionInLine ( ) ; mFLOAT_SUFFIX ( ) ; if ( state . failed ) return ; f4 = new CommonToken ( input , Token . INVALID_TOKEN_TYPE , Token . DEFAULT_CHANNEL , f4Start1221 , getCharIndex ( ) - 1 ) ; f4 . setLine ( f4StartLine1221 ) ; f4 . setCharPositionInLine ( f4StartCharPos1221 ) ; if ( state . backtracking == 0 ) { t = f4 ; } } break ; } if ( state . backtracking == 0 ) { if ( t != null && t . getText ( ) . toUpperCase ( ) . indexOf ( 'F' ) >= 0 ) { _type = NUM_FLOAT ; } else if ( t != null && t . getText ( ) . toUpperCase ( ) . indexOf ( 'M' ) >= 0 ) { _type = NUM_DECIMAL ; } else { _type = NUM_DOUBLE ; // assume double
} } } break ; } } break ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class CookieUtils { /** * Append the input value string to the given buffer , wrapping it with
* quotes if need be .
* @ param buff
* @ param value */
private static void maybeQuote ( StringBuilder buff , String value ) { } } | // PK48169 - handle a null value as well as an empty one
if ( null == value || 0 == value . length ( ) ) { buff . append ( "\"\"" ) ; } else if ( needsQuote ( value ) ) { buff . append ( '"' ) ; buff . append ( value ) ; buff . append ( '"' ) ; } else { buff . append ( value ) ; } |
public class InternalSARLParser { /** * InternalSARL . g : 2739:1 : entryRuleAOPMember returns [ EObject current = null ] : iv _ ruleAOPMember = ruleAOPMember EOF ; */
public final EObject entryRuleAOPMember ( ) throws RecognitionException { } } | EObject current = null ; EObject iv_ruleAOPMember = null ; try { // InternalSARL . g : 2739:50 : ( iv _ ruleAOPMember = ruleAOPMember EOF )
// InternalSARL . g : 2740:2 : iv _ ruleAOPMember = ruleAOPMember EOF
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getAOPMemberRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_ruleAOPMember = ruleAOPMember ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = iv_ruleAOPMember ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return current ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class SecurityUtilities { /** * Look up the top - most element in the current stack representing a
* script and return its protection domain . This relies on the system - wide
* SecurityManager being an instance of { @ link RhinoSecurityManager } ,
* otherwise it returns < code > null < / code > .
* @ return The protection of the top - most script in the current stack , or null */
public static ProtectionDomain getScriptProtectionDomain ( ) { } } | final SecurityManager securityManager = System . getSecurityManager ( ) ; if ( securityManager instanceof RhinoSecurityManager ) { return AccessController . doPrivileged ( new PrivilegedAction < ProtectionDomain > ( ) { @ Override public ProtectionDomain run ( ) { Class < ? > c = ( ( RhinoSecurityManager ) securityManager ) . getCurrentScriptClass ( ) ; return c == null ? null : c . getProtectionDomain ( ) ; } } ) ; } return null ; |
public class SqlExecutor { /** * 执行非查询语句 < br >
* 语句包括 插入 、 更新 、 删除 < br >
* 此方法不会关闭Connection
* @ param conn 数据库连接对象
* @ param sql SQL
* @ param params 参数
* @ return 影响的行数
* @ throws SQLException SQL执行异常 */
public static int execute ( Connection conn , String sql , Object ... params ) throws SQLException { } } | PreparedStatement ps = null ; try { ps = StatementUtil . prepareStatement ( conn , sql , params ) ; return ps . executeUpdate ( ) ; } finally { DbUtil . close ( ps ) ; } |
public class ConnectionImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . MPCoreConnection # deleteSystemDestination ( com . ibm . ws . sib . mfp . JsDestinationAddress ) */
@ Override public void deleteSystemDestination ( String prefix ) throws SINotPossibleInCurrentConfigurationException , SIException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteSystemDestination" , prefix ) ; // See if this connection has been closed
checkNotClosed ( ) ; _destinationManager . deleteSystemDestination ( SIMPUtils . createJsSystemDestinationAddress ( prefix , _messageProcessor . getMessagingEngineUuid ( ) ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteSystemDestination" ) ; |
public class ContextHelper { /** * Whether it is a DELETE request .
* @ param context the web context
* @ return whether it is a DELETE request */
public static boolean isDelete ( final WebContext context ) { } } | return HttpConstants . HTTP_METHOD . DELETE . name ( ) . equalsIgnoreCase ( context . getRequestMethod ( ) ) ; |
public class WorkbenchPanel { /** * Unpins all visible panels .
* @ since 2.5.0
* @ see # pinVisiblePanels ( )
* @ see AbstractPanel # setPinned ( boolean ) */
public void unpinVisiblePanels ( ) { } } | if ( layout == Layout . FULL ) { getTabbedFull ( ) . unpinTabs ( ) ; } else { getTabbedSelect ( ) . unpinTabs ( ) ; getTabbedWork ( ) . unpinTabs ( ) ; getTabbedStatus ( ) . unpinTabs ( ) ; } |
public class ReportQuery { /** * Sets the columns value for this ReportQuery .
* @ param columns * The list of trafficking statistics and revenue information
* being requested
* in the report . The generated report will contain the
* columns in the same
* order as requested . This field is required . */
public void setColumns ( com . google . api . ads . admanager . axis . v201808 . Column [ ] columns ) { } } | this . columns = columns ; |
public class TextAnalyticsImpl { /** * The API returns a list of strings denoting the key talking points in the input text .
* See the & lt ; a href = " https : / / docs . microsoft . com / en - us / azure / cognitive - services / text - analytics / overview # supported - languages " & gt ; Text Analytics Documentation & lt ; / a & gt ; for details about the languages that are supported by key phrase extraction .
* @ param keyPhrasesOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the KeyPhraseBatchResult object */
public Observable < KeyPhraseBatchResult > keyPhrasesAsync ( KeyPhrasesOptionalParameter keyPhrasesOptionalParameter ) { } } | return keyPhrasesWithServiceResponseAsync ( keyPhrasesOptionalParameter ) . map ( new Func1 < ServiceResponse < KeyPhraseBatchResult > , KeyPhraseBatchResult > ( ) { @ Override public KeyPhraseBatchResult call ( ServiceResponse < KeyPhraseBatchResult > response ) { return response . body ( ) ; } } ) ; |
public class TransactionManager { /** * Called by TransactionScope . */
boolean setLocalScope ( TransactionScope < Txn > scope , boolean detached ) { } } | TransactionScope < Txn > existing = mLocalScope . get ( ) ; if ( ( ( existing == null || existing . isInactive ( ) ) && detached ) || existing == scope ) { attachNotification ( scope . getActiveTxn ( ) ) ; mLocalScope . set ( scope ) ; return true ; } return false ; |
public class EnglishGrammaticalStructure { /** * This rewrites the " conj " relation to " conj _ word " and deletes cases of the
* " cc " relation providing this rewrite has occurred ( but not if there is only
* something like a clause - initial and ) . For instance , cc ( elected - 5 , and - 9)
* conj ( elected - 5 , re - elected - 11 ) becomes conj _ and ( elected - 5 , re - elected - 11)
* @ param list List of dependencies . */
private static void collapseConj ( Collection < TypedDependency > list ) { } } | List < TreeGraphNode > govs = new ArrayList < TreeGraphNode > ( ) ; // find typed deps of form cc ( gov , dep )
for ( TypedDependency td : list ) { if ( td . reln ( ) == COORDINATION ) { // i . e . " cc "
TreeGraphNode gov = td . gov ( ) ; GrammaticalRelation conj = conjValue ( td . dep ( ) . value ( ) ) ; if ( DEBUG ) { System . err . println ( "Set conj to " + conj + " based on " + td ) ; } // find other deps of that gov having reln " conj "
boolean foundOne = false ; for ( TypedDependency td1 : list ) { if ( td1 . gov ( ) == gov ) { if ( td1 . reln ( ) == CONJUNCT ) { // i . e . , " conj "
// change " conj " to the actual ( lexical ) conjunction
if ( DEBUG ) { System . err . println ( "Changing " + td1 + " to have relation " + conj ) ; } td1 . setReln ( conj ) ; foundOne = true ; } else if ( td1 . reln ( ) == COORDINATION ) { conj = conjValue ( td1 . dep ( ) . value ( ) ) ; if ( DEBUG ) { System . err . println ( "Set conj to " + conj + " based on " + td1 ) ; } } } } // register to remove cc from this governor
if ( foundOne ) { govs . add ( gov ) ; } } } // now remove typed dependencies with reln " cc " if we have successfully
// collapsed
for ( Iterator < TypedDependency > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { TypedDependency td2 = iter . next ( ) ; if ( td2 . reln ( ) == COORDINATION && govs . contains ( td2 . gov ( ) ) ) { iter . remove ( ) ; } } |
public class Cron4jNow { protected Cron4jJob createCron4jJob ( LaJobKey jobKey , JobSubIdentityAttr subIdentityAttr , List < LaJobKey > triggeringJobKeyList , OptionalThing < String > cron4jId , Cron4jTask cron4jTask ) { } } | final Cron4jJob job = newCron4jJob ( jobKey , subIdentityAttr . getJobNote ( ) , subIdentityAttr . getJobUnique ( ) , cron4jId . map ( id -> Cron4jId . of ( id ) ) , cron4jTask , this ) ; triggeringJobKeyList . forEach ( triggeringJobKey -> { findJobByKey ( triggeringJobKey ) . alwaysPresent ( triggeringJob -> { triggeringJob . registerNext ( jobKey ) ; } ) ; } ) ; return job ; |
public class Collections { /** * Create an ARRAY comprehension with a first WITHIN range .
* The ARRAY operator lets you map and filter the elements or attributes of a collection , object , or objects .
* It evaluates to an array of the operand expression , that satisfies the WHEN clause , if provided .
* For elements , IN ranges in the direct elements of its array expression , WITHIN also ranges in its descendants . */
public static WhenBuilder arrayWithin ( Expression arrayExpression , String variable , Expression expression ) { } } | return new WhenBuilder ( x ( "ARRAY " + arrayExpression . toString ( ) + " FOR" ) , variable , expression , false ) ; |
public class StatisticalTagger { /** * Get morphological analysis from a tokenized sentence .
* @ param tokens
* the tokenized sentence
* @ return a list of { @ code Morpheme } objects containing morphological info */
public final List < Morpheme > getMorphemes ( final String [ ] tokens ) { } } | final List < String > origPosTags = posAnnotate ( tokens ) ; final List < Morpheme > morphemes = getMorphemesFromStrings ( origPosTags , tokens ) ; return morphemes ; |
public class JBossASClient { /** * Convienence method that allows you to obtain a single attribute ' s string value from
* a resource .
* @ param attributeName the attribute whose value is to be returned
* @ param address identifies the resource
* @ return the attribute value
* @ throws Exception if failed to obtain the attribute value */
public String getStringAttribute ( String attributeName , Address address ) throws Exception { } } | return getStringAttribute ( false , attributeName , address ) ; |
public class ComparatorResultBuilder { /** * Performs the comparison between 2 { @ link Comparable } objects .
* @ param obj1 { @ link Comparable } object in the comparison operation .
* @ param obj2 { @ link Comparable } object in the comparison operation .
* @ return this { @ link ComparatorResultBuilder } .
* @ see org . cp . elements . util . ComparatorResultBuilder
* @ see # compare ( Comparable , Comparable ) */
@ NullSafe public ComparatorResultBuilder < T > doCompare ( T obj1 , T obj2 ) { } } | this . result = ( this . result != 0 ? this . result : compare ( obj1 , obj2 ) ) ; return this ; |
public class KamStoreServiceImpl { /** * { @ inheritDoc } */
@ Override public List < KamNode > getKamNodes ( KamHandle kamHandle , final List < Node > nodes ) throws KamStoreServiceException { } } | final String handle = kamHandle . getHandle ( ) ; try { final org . openbel . framework . api . Kam kam = kamCacheService . getKam ( handle ) ; if ( kam == null ) { throw new KamStoreServiceException ( format ( KAM_REQUEST_NO_KAM_FOR_HANDLE , handle ) ) ; } final List < KamNode > resolvedKamNodes = sizedArrayList ( nodes . size ( ) ) ; for ( final Node node : nodes ) { resolvedKamNodes . add ( convert ( kam . getKamInfo ( ) , kAMStore . getKamNode ( kam , node . getLabel ( ) ) ) ) ; } return resolvedKamNodes ; } catch ( KAMStoreException e ) { throw new KamStoreServiceException ( e ) ; } |
public class FlyWeightFlatXmlProducer { /** * Wraps a { @ link SAXException } into a { @ link DataSetException }
* @ param cause The cause to be wrapped into a { @ link DataSetException }
* @ return A { @ link DataSetException } that wraps the given { @ link SAXException } */
protected final static DataSetException buildException ( SAXException cause ) { } } | int lineNumber = - 1 ; if ( cause instanceof SAXParseException ) { lineNumber = ( ( SAXParseException ) cause ) . getLineNumber ( ) ; } Exception exception = cause . getException ( ) == null ? cause : cause . getException ( ) ; String message ; if ( lineNumber >= 0 ) { message = "Line " + lineNumber + ": " + exception . getMessage ( ) ; } else { message = exception . getMessage ( ) ; } if ( exception instanceof DataSetException ) { return ( DataSetException ) exception ; } else { return new DataSetException ( message , exception ) ; } |
public class ZoomControl { /** * Initialize handlers for mobile devices . */
private void initializeForTouchDevice ( ) { } } | logger . log ( Level . FINE , "ZoomControl -> initializeForTouchDevice()" ) ; // Add touch handlers to the zoom in button :
zoomInElement . addDomHandler ( new TouchStartHandler ( ) { @ Override public void onTouchStart ( TouchStartEvent event ) { event . stopPropagation ( ) ; event . preventDefault ( ) ; logger . log ( Level . FINE , "ZoomControl -> zoomInElement onTouchStart()" ) ; ViewPort viewPort = mapPresenter . getViewPort ( ) ; int index = viewPort . getResolutionIndex ( viewPort . getResolution ( ) ) ; if ( index < viewPort . getResolutionCount ( ) - 1 ) { viewPort . applyResolution ( viewPort . getResolution ( index + 1 ) ) ; viewPort . getPosition ( ) ; } } } , TouchStartEvent . getType ( ) ) ; // Add touch handlers to the zoom out button :
zoomOutElement . addDomHandler ( new TouchStartHandler ( ) { @ Override public void onTouchStart ( TouchStartEvent event ) { logger . log ( Level . FINE , "zoomOutElement -> zoomInElement onTouchStart()" ) ; event . stopPropagation ( ) ; event . preventDefault ( ) ; ViewPort viewPort = mapPresenter . getViewPort ( ) ; int index = viewPort . getResolutionIndex ( viewPort . getResolution ( ) ) ; if ( index > 0 ) { viewPort . applyResolution ( viewPort . getResolution ( index - 1 ) ) ; } } } , TouchStartEvent . getType ( ) ) ; |
public class NodeTypeImpl { /** * Returns true if satisfy type and constrains . Otherwise returns false .
* @ param requiredType - type .
* @ param value - value .
* @ param constraints - constraints .
* @ return a boolean . */
private boolean canSetPropertyForType ( int requiredType , Value value , String [ ] constraints ) { } } | if ( requiredType == value . getType ( ) ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else if ( requiredType == PropertyType . BINARY && ( value . getType ( ) == PropertyType . STRING || value . getType ( ) == PropertyType . DATE || value . getType ( ) == PropertyType . LONG || value . getType ( ) == PropertyType . DOUBLE || value . getType ( ) == PropertyType . NAME || value . getType ( ) == PropertyType . PATH || value . getType ( ) == PropertyType . BOOLEAN ) ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else if ( requiredType == PropertyType . BOOLEAN ) { if ( value . getType ( ) == PropertyType . STRING ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { try { return isCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { // Hm , this is not string and not UTF - 8 too
return false ; } } else { return false ; } } else if ( requiredType == PropertyType . DATE ) { String likeDataString = null ; try { if ( value . getType ( ) == PropertyType . STRING ) { likeDataString = value . getString ( ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { likeDataString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . DOUBLE || value . getType ( ) == PropertyType . LONG ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else { return false ; } // try parse . . .
JCRDateFormat . parse ( likeDataString ) ; // validate
return checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { // Hm , this is not date format string
return false ; } } else if ( requiredType == PropertyType . DOUBLE ) { String likeDoubleString = null ; try { if ( value . getType ( ) == PropertyType . STRING ) { likeDoubleString = value . getString ( ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { likeDoubleString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . DATE ) { return true ; } else if ( value . getType ( ) == PropertyType . LONG ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else { return false ; } Double doubleValue = new Double ( likeDoubleString ) ; return doubleValue != null && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { // Hm , this is not double formated string
return false ; } } else if ( requiredType == PropertyType . LONG ) { String likeLongString = null ; try { if ( value . getType ( ) == PropertyType . STRING ) { likeLongString = value . getString ( ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { likeLongString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . DATE ) { return true ; } else if ( value . getType ( ) == PropertyType . DOUBLE ) { return true ; } else { return false ; } Long longValue = new Long ( likeLongString ) ; return longValue != null && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { // Hm , this is not long formated string
return false ; } } else if ( requiredType == PropertyType . NAME ) { String likeNameString = null ; try { if ( value . getType ( ) == PropertyType . STRING ) { likeNameString = value . getString ( ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { likeNameString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . PATH ) { String pathString = value . getString ( ) ; String [ ] pathParts = pathString . split ( "\\/" ) ; if ( pathString . startsWith ( "/" ) && ( pathParts . length > 1 || pathString . indexOf ( "[" ) > 0 ) ) { // Path is not relative - absolute
// FALSE if it is more than one element long
// or has an index
return false ; } else if ( ! pathString . equals ( "/" ) && pathParts . length == 1 && pathString . indexOf ( "[" ) < 0 ) { // Path is relative
// TRUE if it is one element long
// and has no index
return checkValueConstraints ( requiredType , constraints , value ) ; } else if ( pathString . startsWith ( "/" ) && pathString . lastIndexOf ( "/" ) < 1 && pathString . indexOf ( "[" ) < 0 ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else { return false ; } } else { return false ; } try { Value nameValue = valueFactory . createValue ( likeNameString , requiredType ) ; return nameValue != null && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { return false ; } } catch ( Exception e ) { return false ; } } else if ( requiredType == PropertyType . PATH ) { String likeNameString = null ; try { if ( value . getType ( ) == PropertyType . STRING ) { likeNameString = value . getString ( ) ; } else if ( value . getType ( ) == PropertyType . BINARY ) { likeNameString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . NAME ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else { return false ; } try { Value nameValue = valueFactory . createValue ( likeNameString , requiredType ) ; return nameValue != null && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { return false ; } } catch ( Exception e ) { return false ; } } else if ( requiredType == PropertyType . STRING ) { String likeStringString = null ; try { if ( value . getType ( ) == PropertyType . BINARY ) { likeStringString = getCharsetString ( value . getString ( ) , Constants . DEFAULT_ENCODING ) ; } else if ( value . getType ( ) == PropertyType . DATE || value . getType ( ) == PropertyType . LONG || value . getType ( ) == PropertyType . BOOLEAN || value . getType ( ) == PropertyType . NAME || value . getType ( ) == PropertyType . PATH || value . getType ( ) == PropertyType . DOUBLE ) { likeStringString = value . getString ( ) ; } else { return false ; } return likeStringString != null && checkValueConstraints ( requiredType , constraints , value ) ; } catch ( Exception e ) { return false ; } } else if ( requiredType == PropertyType . UNDEFINED ) { return checkValueConstraints ( requiredType , constraints , value ) ; } else { return false ; } |
public class AsyncConnection { /** * { @ inheritDoc } .
* Closing the { @ link AsyncConnection } will attempt a graceful shutdown of the { @ link # executorService } with a
* timeout of { @ link # shutdownTimeout } , allowing the current events to be submitted while new events will
* be rejected . < br >
* If the shutdown times out , the { @ code executorService } will be forced to shutdown . */
@ Override public void close ( ) throws IOException { } } | if ( gracefulShutdown ) { Util . safelyRemoveShutdownHook ( shutDownHook ) ; shutDownHook . enabled = false ; } doClose ( ) ; |
public class IOUtil { /** * Creates a copy of a file .
* Shorthand for < code > copyFile ( from , to , false ) < / code > , < code > false < / code >
* meaning don ' t overwrite existing file .
* @ param from
* - source File
* @ param to
* - destination File
* @ throws RuntimeIOException */
public static void copyFile ( File from , File to ) throws RuntimeIOException { } } | copyFile ( from , to , false ) ; |
public class AbstractBaseSource { /** * Create a reader for the specified resource .
* @ param resource resource to create reader for
* @ return reader for the specified resource */
protected Reader createResourceReader ( Resource resource ) { } } | try { return new InputStreamReader ( resource . getInputStream ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } |
public class RedisClusterClient { /** * Create a connection to a redis socket address .
* @ param codec Use this codec to encode / decode keys and values , must not be { @ literal null }
* @ param nodeId the nodeId
* @ param clusterWriter global cluster writer
* @ param socketAddressSupplier supplier for the socket address
* @ param < K > Key type
* @ param < V > Value type
* @ return A new connection */
< K , V > StatefulRedisConnection < K , V > connectToNode ( RedisCodec < K , V > codec , String nodeId , RedisChannelWriter clusterWriter , Mono < SocketAddress > socketAddressSupplier ) { } } | return getConnection ( connectToNodeAsync ( codec , nodeId , clusterWriter , socketAddressSupplier ) ) ; |
public class HotdeployUtil { public static Object deserializeInternal ( final byte [ ] bytes ) throws Exception { } } | if ( bytes == null ) { return null ; } final ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; final Class < ? > rebuilderClass = LdiClassLoaderUtil . loadClass ( loader , REBUILDER_CLASS_NAME ) ; final Rebuilder rebuilder = ( Rebuilder ) LdiClassUtil . newInstance ( rebuilderClass ) ; return rebuilder . deserialize ( bytes ) ; |
public class FileRecyclerViewAdapter { /** * Encodes a bitmap to a byte array .
* @ param bitmap the bitmap to compress
* @ param format the compression format for the Bitmap
* @ return { @ code byte [ ] } object */
public static byte [ ] encodeBitmapToArray ( Bitmap bitmap , Bitmap . CompressFormat format ) { } } | ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; bitmap . compress ( format , 0 , outputStream ) ; return outputStream . toByteArray ( ) ; |
public class BatchDetectSyntaxItemResult { /** * The syntax tokens for the words in the document , one token for each word .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSyntaxTokens ( java . util . Collection ) } or { @ link # withSyntaxTokens ( java . util . Collection ) } if you want to
* override the existing values .
* @ param syntaxTokens
* The syntax tokens for the words in the document , one token for each word .
* @ return Returns a reference to this object so that method calls can be chained together . */
public BatchDetectSyntaxItemResult withSyntaxTokens ( SyntaxToken ... syntaxTokens ) { } } | if ( this . syntaxTokens == null ) { setSyntaxTokens ( new java . util . ArrayList < SyntaxToken > ( syntaxTokens . length ) ) ; } for ( SyntaxToken ele : syntaxTokens ) { this . syntaxTokens . add ( ele ) ; } return this ; |
public class BBR { /** * Gets the tentative update & delta ; < sub > vj < / sub >
* @ param columnMajor the column major vector array . May be null if using
* the implicit bias term
* @ param j the column to work on
* @ param w _ j the value of the coefficient , used only under Gaussian prior
* @ param y the array of label values
* @ param r the array of r values
* @ param lambda the regularization value to apply
* @ param s the update direction ( should be + 1 or - 1 ) . Used only under
* Laplace prior
* @ param delta the array of delta values
* @ return the tentative update value */
private double tenativeUpdate ( final Vec [ ] columnMajor , final int j , final double w_j , final double [ ] y , final double [ ] r , final double lambda , final double s , final double [ ] delta ) { } } | double numer = 0 , denom = 0 ; if ( columnMajor != null ) { Vec col_j = columnMajor [ j ] ; if ( col_j . nnz ( ) == 0 ) return 0 ; for ( IndexValue iv : col_j ) { final double x_ij = iv . getValue ( ) ; final int i = iv . getIndex ( ) ; numer += x_ij * y [ i ] / ( 1 + exp ( r [ i ] ) ) ; denom += x_ij * x_ij * F ( r [ i ] , delta [ j ] * abs ( x_ij ) ) ; if ( prior == Prior . LAPLACE ) numer -= lambda * s ; else { numer -= w_j / lambda ; denom += 1 / lambda ; } } } else // bias term , all x _ ij = 1
for ( int i = 0 ; i < y . length ; i ++ ) { numer += y [ i ] / ( 1 + exp ( r [ i ] ) ) - lambda * s ; denom += F ( r [ i ] , delta [ j ] ) ; } return numer / denom ; |
public class AbstractWebApplicationServiceResponseBuilder { /** * Build redirect .
* @ param service the service
* @ param parameters the parameters
* @ return the response */
protected Response buildRedirect ( final WebApplicationService service , final Map < String , String > parameters ) { } } | return DefaultResponse . getRedirectResponse ( service . getOriginalUrl ( ) , parameters ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.