signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MaterializeKNNPreprocessor { /** * Informs all registered KNNListener that new kNNs have been inserted and as
* a result some kNNs have been changed .
* @ param insertions the ids of the newly inserted kNNs
* @ param updates the ids of kNNs which have been changed due to the
* insertions
* @ see KNNListener */
protected void fireKNNsInserted ( DBIDs insertions , DBIDs updates ) { } } | KNNChangeEvent e = new KNNChangeEvent ( this , KNNChangeEvent . Type . INSERT , insertions , updates ) ; Object [ ] listeners = listenerList . getListenerList ( ) ; for ( int i = listeners . length - 2 ; i >= 0 ; i -= 2 ) { if ( listeners [ i ] == KNNListener . class ) { ( ( KNNListener ) listeners [ i + 1 ] ) . kNNsChanged ( e ) ; } } |
public class PrivateKeyReader { /** * Constructs from the given root , parent directory and file name the file and reads the private
* key .
* @ param root
* the root directory of the parent directory
* @ param directory
* the parent directory of the private key file
* @ param fileName
* the file name of the file that contains the private key
* @ return the private key
* @ throws NoSuchAlgorithmException
* is thrown if instantiation of the SecretKeyFactory object fails .
* @ throws InvalidKeySpecException
* is thrown if generation of the SecretKey object fails .
* @ throws NoSuchProviderException
* the no such provider exception
* @ throws IOException
* Signals that an I / O exception has occurred . */
public static PrivateKey readPrivateKey ( final File root , final String directory , final String fileName ) throws NoSuchAlgorithmException , InvalidKeySpecException , NoSuchProviderException , IOException { } } | final File privatekeyDir = new File ( root , directory ) ; final File privatekeyFile = new File ( privatekeyDir , fileName ) ; final PrivateKey privateKey = PrivateKeyReader . readPrivateKey ( privatekeyFile ) ; return privateKey ; |
public class CRFClassifier { /** * Scales the weights of this crfclassifier by the specified weight
* @ param scale */
public void scaleWeights ( double scale ) { } } | for ( int i = 0 ; i < weights . length ; i ++ ) { for ( int j = 0 ; j < weights [ i ] . length ; j ++ ) { weights [ i ] [ j ] *= scale ; } } |
public class AbstractTypeConvertingMap { /** * Helper method for obtaining integer value from parameter
* @ param name The name of the parameter
* @ return The integer value or null if there isn ' t one */
public Byte getByte ( String name ) { } } | Object o = get ( name ) ; if ( o instanceof Number ) { return ( ( Number ) o ) . byteValue ( ) ; } if ( o != null ) { try { String string = o . toString ( ) ; if ( string != null && string . length ( ) > 0 ) { return Byte . parseByte ( string ) ; } } catch ( NumberFormatException e ) { } } return null ; |
public class IiopOpenJdkPresenter { /** * - - - - - iiop methods */
public void save ( Map < String , Object > changedValues ) { } } | operationDelegate . onSaveResource ( IIOP_OPENJDK_SUBSYSTEM_TEMPLATE , null , changedValues , new CrudOperationDelegate . Callback ( ) { @ Override public void onSuccess ( final AddressTemplate addressTemplate , final String name ) { Console . info ( Console . MESSAGES . modified ( "IIOP Subsystem" ) ) ; refresh ( ) ; } @ Override public void onFailure ( final AddressTemplate addressTemplate , final String name , final Throwable t ) { Console . error ( Console . MESSAGES . modificationFailed ( "IIOP Subsystem" ) , t . getMessage ( ) ) ; refresh ( ) ; } } ) ; |
public class QueryAtomContainer { /** * Adds a single electron to this AtomContainer .
* @ param singleElectron The SingleElectron to added to this container */
@ Override public void addSingleElectron ( ISingleElectron singleElectron ) { } } | if ( singleElectronCount >= singleElectrons . length ) growSingleElectronArray ( ) ; singleElectrons [ singleElectronCount ] = singleElectron ; ++ singleElectronCount ; notifyChanged ( ) ; |
public class AmqpTable { /** * Adds a long string entry to the AmqpTable .
* @ param key name of an entry
* @ param value long string value of an entry
* @ return AmqpTable object that holds the table of entries */
public AmqpTable addLongString ( String key , String value ) { } } | this . add ( key , value , AmqpType . LONGSTRING ) ; return this ; |
public class WalkerState { /** * ensures that the first invocation of a date seeking
* rule is captured */
private void markDateInvocation ( ) { } } | _updatePreviousDates = ! _dateGivenInGroup ; _dateGivenInGroup = true ; _dateGroup . setDateInferred ( false ) ; if ( _firstDateInvocationInGroup ) { // if a time has been given within the current date group ,
// we capture the current time before resetting the calendar
if ( _timeGivenInGroup ) { int hours = _calendar . get ( Calendar . HOUR_OF_DAY ) ; int minutes = _calendar . get ( Calendar . MINUTE ) ; int seconds = _calendar . get ( Calendar . SECOND ) ; resetCalendar ( ) ; _calendar . set ( Calendar . HOUR_OF_DAY , hours ) ; _calendar . set ( Calendar . MINUTE , minutes ) ; _calendar . set ( Calendar . SECOND , seconds ) ; } else { resetCalendar ( ) ; } _firstDateInvocationInGroup = false ; } |
public class XIdentityExtension { /** * Retrieves the id of a log data hierarchy element , if set by this
* extension ' s id attribute .
* @ param element
* Log hierarchy element to extract name from .
* @ return The requested element id . */
public XID extractID ( XAttributable element ) { } } | XAttribute attribute = element . getAttributes ( ) . get ( KEY_ID ) ; if ( attribute == null ) { return null ; } else { return ( ( XAttributeID ) attribute ) . getValue ( ) ; } |
public class ControlFileHandler { /** * ControlFileHandler - Constructor .
* @ param record My owner ( usually passed as null , and set on addListener in setOwner ( ) ) . */
public void init ( Record record ) { } } | super . init ( record ) ; this . setMasterSlaveFlag ( FileListener . RUN_IN_MASTER | FileListener . DONT_REPLICATE_TO_SLAVE ) ; |
public class Setup { /** * Reads from project . yaml */
public String getMdwVersion ( ) throws IOException { } } | if ( mdwVersion == null ) { YamlProperties yaml = getProjectYaml ( ) ; if ( yaml != null ) { mdwVersion = yaml . getString ( Props . ProjectYaml . MDW_VERSION ) ; } } return mdwVersion ; |
public class StreamUtil { /** * Copies information from the input stream to the output stream , using the default copy buffer size .
* @ param in the source stream .
* @ param out the destination stream .
* @ throws IOException if there is an error reading or writing to the streams . */
public static void copy ( final InputStream in , final OutputStream out ) throws IOException { } } | copy ( in , out , DEFAULT_BUFFER_SIZE ) ; |
public class StringHelper { /** * Check if any of the passed searched characters in contained in the input
* string .
* @ param sInput
* The input string . May be < code > null < / code > .
* @ param aSearchChars
* The char array to search . May not be < code > null < / code > .
* @ return < code > true < / code > if at least any of the search char is contained in
* the input char array , < code > false < / code > otherwise . */
public static boolean containsAny ( @ Nullable final String sInput , @ Nonnull final char [ ] aSearchChars ) { } } | return sInput != null && containsAny ( sInput . toCharArray ( ) , aSearchChars ) ; |
public class LayerDrawable { /** * Sets an explicit size for the specified layer .
* < strong > Note : < / strong > Setting an explicit layer size changes the
* default layer gravity behavior . See { @ link # setLayerGravity ( int , int ) } for more information .
* @ param index the index of the layer to adjust
* @ param w width in pixels , or - 1 to use the intrinsic width
* @ param h height in pixels , or - 1 to use the intrinsic height
* @ attr ref android . R . styleable # LayerDrawableItem _ width
* @ attr ref android . R . styleable # LayerDrawableItem _ height
* @ see # getLayerWidth ( int )
* @ see # getLayerHeight ( int ) */
public void setLayerSize ( int index , int w , int h ) { } } | final ChildDrawable childDrawable = mLayerState . mChildren [ index ] ; childDrawable . mWidth = w ; childDrawable . mHeight = h ; |
public class DateUtil { /** * 获取指定年份的天数
* @ param date 指定年份
* @ return 指定年份对应的天数 */
public static int getYearDay ( Date date ) { } } | Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return calendar . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; |
public class ConnectionUtils { /** * Cleanly close a connection , by shutting down and flushing writes and then draining reads .
* If this fails the connection is forcibly closed .
* @ param connection The connection
* @ param additional Any additional resources to close once the connection has been closed */
public static void cleanClose ( StreamConnection connection , Closeable ... additional ) { } } | try { connection . getSinkChannel ( ) . shutdownWrites ( ) ; if ( ! connection . getSinkChannel ( ) . flush ( ) ) { connection . getSinkChannel ( ) . setWriteListener ( ChannelListeners . flushingChannelListener ( new ChannelListener < ConduitStreamSinkChannel > ( ) { @ Override public void handleEvent ( ConduitStreamSinkChannel channel ) { doDrain ( connection , additional ) ; } } , new ChannelExceptionHandler < ConduitStreamSinkChannel > ( ) { @ Override public void handleException ( ConduitStreamSinkChannel channel , IOException exception ) { UndertowLogger . REQUEST_IO_LOGGER . ioException ( exception ) ; IoUtils . safeClose ( connection ) ; IoUtils . safeClose ( additional ) ; } } ) ) ; connection . getSinkChannel ( ) . resumeWrites ( ) ; } else { doDrain ( connection , additional ) ; } } catch ( Throwable e ) { if ( e instanceof IOException ) { UndertowLogger . REQUEST_IO_LOGGER . ioException ( ( IOException ) e ) ; } else { UndertowLogger . REQUEST_IO_LOGGER . ioException ( new IOException ( e ) ) ; } IoUtils . safeClose ( connection ) ; IoUtils . safeClose ( additional ) ; } |
public class MultivaluedPersonAttributeUtils { /** * Translate from a more flexible Attribute to Attribute mapping format to a Map
* from String to Set of Strings .
* The point of the map is to map from attribute names in the underlying data store
* ( e . g . , JDBC column names , LDAP attribute names ) to uPortal attribute names .
* Any given underlying data store attribute might map to zero uPortal
* attributes ( not appear in the map at all ) , map to exactly one uPortal attribute
* ( appear in the Map as a mapping from a String to a String or as a mapping
* from a String to a Set containing just one String ) , or map to several uPortal
* attribute names ( appear in the Map as a mapping from a String to a Set
* of Strings ) .
* This method takes as its argument a { @ link Map } that must have keys of
* type { @ link String } and values of type { @ link String } or { @ link Set } of
* { @ link String } s . The argument must not be null and must have no null
* keys . It must contain no keys other than Strings and no values other
* than Strings or Sets of Strings . This method will convert any non - string
* values to a String using the object ' s toString ( ) method .
* This method returns a Map equivalent to its argument except whereever there
* was a String value in the Map there will instead be an immutable Set containing
* the String value . That is , the return value is normalized to be a Map from
* String to Set ( of String ) .
* @ param mapping { @ link Map } from String names of attributes in the underlying store
* to uP attribute names or Sets of such names .
* @ return a Map from String to Set of Strings */
public static Map < String , Set < String > > parseAttributeToAttributeMapping ( final Map < String , ? extends Object > mapping ) { } } | // null is assumed to be an empty map
if ( mapping == null ) { return new HashMap < > ( ) ; } final Map < String , Set < String > > mappedAttributesBuilder = new LinkedHashMap < > ( ) ; for ( final Map . Entry < String , ? extends Object > mappingEntry : mapping . entrySet ( ) ) { final String sourceAttrName = mappingEntry . getKey ( ) ; Validate . notNull ( sourceAttrName , "attribute name can not be null in Map" ) ; final Object mappedAttribute = mappingEntry . getValue ( ) ; // Create a mapping to null
if ( mappedAttribute == null ) { mappedAttributesBuilder . put ( sourceAttrName , null ) ; } // Create a single item set for the string mapping
else if ( mappedAttribute instanceof String ) { final Set < String > mappedSet = new HashSet < > ( ) ; mappedSet . add ( mappedAttribute . toString ( ) ) ; mappedAttributesBuilder . put ( sourceAttrName , mappedSet ) ; } // Create a defenisve copy of the mapped set & verify its contents are strings
else if ( mappedAttribute instanceof Collection ) { final Collection < ? > sourceSet = ( Collection < ? > ) mappedAttribute ; // Ensure the collection only contains strings .
final Set < String > mappedSet = new LinkedHashSet < > ( ) ; for ( final Object sourceObj : sourceSet ) { if ( sourceObj != null ) { mappedSet . add ( sourceObj . toString ( ) ) ; } else { mappedSet . add ( null ) ; } } mappedAttributesBuilder . put ( sourceAttrName , mappedSet ) ; } // Not a valid type for the mapping
else { throw new IllegalArgumentException ( "Invalid mapped type. key='" + sourceAttrName + "', value type='" + mappedAttribute . getClass ( ) . getName ( ) + "'" ) ; } } return new HashMap < > ( mappedAttributesBuilder ) ; |
public class DefaultBackendSecurity { /** * Post - Initializes the Module based on configuration parameters . The
* implementation of this method is dependent on the schema used to define
* the parameter names for the role of
* < code > org . fcrepo . server . storage . DefaultBackendSecurity < / code > .
* @ throws ModuleInitializationException
* If initialization values are invalid or initialization fails for
* some other reason . */
@ Override public void postInitModule ( ) throws ModuleInitializationException { } } | try { logger . debug ( "DefaultBackendSecurity initialized" ) ; String fedoraHome = Constants . FEDORA_HOME ; if ( fedoraHome == null ) { throw new ModuleInitializationException ( "[DefaultBackendSecurity] Module failed to initialize: " + "FEDORA_HOME is undefined" , getRole ( ) ) ; } else { m_beSecurityPath = fedoraHome + "/server/config/beSecurity.xml" ; } logger . debug ( "m_beSecurityPath: " + m_beSecurityPath ) ; String validate = getParameter ( "beSecurity_validation" ) ; if ( validate != null ) { if ( ! validate . equals ( "true" ) && ! validate . equals ( "false" ) ) { logger . warn ( "Validation setting for backend " + "security configuration file must be either \"true\" or \"false\". " + "Value specified was: \"" + validate + "\". Validation is defaulted to " + "\"false\"." ) ; } else { m_validate = Boolean . parseBoolean ( validate ) ; } } else { logger . warn ( "Validation setting for backend " + "security configuration file was not specified. Validation is defaulted to " + "\"false\"." ) ; } logger . debug ( "beSecurity_validate: " + m_validate ) ; m_encoding = getParameter ( "beSecurity_char_encoding" ) ; if ( m_encoding == null ) { m_encoding = "utf-8" ; logger . warn ( "Character encoding for backend " + "security configuration file was not specified. Encoding defaulted to " + "\"utf-8\"." ) ; } logger . debug ( "beSecurity_char_encoding: " + m_encoding ) ; // initialize static BackendSecuritySpec instance
setBackendSecuritySpec ( ) ; if ( logger . isDebugEnabled ( ) ) { Set < String > roleList = beSS . listRoleKeys ( ) ; Iterator < String > iter = roleList . iterator ( ) ; while ( iter . hasNext ( ) ) { logger . debug ( "beSecurity ROLE: " + iter . next ( ) ) ; } } } catch ( Throwable th ) { throw new ModuleInitializationException ( "[DefaultBackendSecurity] " + "BackendSecurity " + "could not be instantiated. The underlying error was a " + th . getClass ( ) . getName ( ) + "The message was \"" + th . getMessage ( ) + "\"." , getRole ( ) ) ; } |
public class HtmlDocletWriter { /** * Return the link for the given member .
* @ param context the id of the context where the link will be printed .
* @ param classDoc the classDoc that we should link to . This is not
* necessarily equal to doc . containingClass ( ) . We may be
* inheriting comments .
* @ param doc the member being linked to .
* @ param label the label for the link .
* @ param strong true if the link should be strong .
* @ param isProperty true if the doc parameter is a JavaFX property .
* @ return the link for the given member . */
public Content getDocLink ( LinkInfoImpl . Kind context , ClassDoc classDoc , MemberDoc doc , String label , boolean strong , boolean isProperty ) { } } | return getDocLink ( context , classDoc , doc , new StringContent ( check ( label ) ) , strong , isProperty ) ; |
public class StageActivityBehavior { /** * termination / / / / / */
protected boolean isAbleToTerminate ( CmmnActivityExecution execution ) { } } | List < ? extends CmmnExecution > children = execution . getCaseExecutions ( ) ; if ( children != null && ! children . isEmpty ( ) ) { for ( CmmnExecution child : children ) { // the guard " ! child . isCompleted ( ) " is needed ,
// when an exitCriteria is triggered on a stage , and
// the referenced sentry contains an onPart to a child
// case execution which has defined as standardEvent " complete " .
// In that case the completed child case execution is still
// in the list of child case execution of the parent case execution .
if ( ! child . isTerminated ( ) && ! child . isCompleted ( ) ) { return false ; } } } return true ; |
public class DefaultApplicationObjectConfigurer { /** * Sets the icons of the given object .
* The icons are loaded from this instance ' s { @ link IconSource } . using a
* key in the format
* < pre >
* & lt ; objectName & gt ; . someIconType
* < / pre >
* The keys used to retrieve large icons from the icon source are created by
* concatenating the given { @ code objectName } with a dot ( . ) , the text
* ' large ' and then an icon type like so :
* < pre >
* & lt ; myObjectName & gt ; . large . someIconType
* < / pre >
* If the icon source cannot find an icon under that key , the object ' s icon
* will be set to null .
* If the { @ code loadOptionalIcons } flag is set to true ( it is by default )
* all the following icon types will be used . If the flag is false , only the
* first will be used :
* < ul >
* < li > { @ value # ICON _ KEY } < / li >
* < li > { @ value # SELECTED _ ICON _ KEY } < / li >
* < li > { @ value # ROLLOVER _ ICON _ KEY } < / li >
* < li > { @ value # DISABLED _ ICON _ KEY } < / li >
* < li > { @ value # PRESSED _ ICON _ KEY } < / li >
* < / ul >
* @ param configurable The object to be configured . Must not be null .
* @ param objectName The name of the configurable object , unique within the
* application . Must not be null .
* @ throws IllegalArgumentException if either argument is null . */
protected void configureCommandIcons ( CommandIconConfigurable configurable , String objectName ) { } } | Assert . notNull ( configurable , "configurable" ) ; Assert . notNull ( objectName , "objectName" ) ; setIconInfo ( configurable , objectName , false ) ; setIconInfo ( configurable , objectName , true ) ; |
public class CASE { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > start a CASE expression on the result of the preceding RETURN statement < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > CASE . result ( ) < / b > < / i > < / div >
* < br / > */
public static CaseTerminal result ( ) { } } | CaseExpression cx = new CaseExpression ( ) ; CaseTerminal ret = CaseFactory . createCaseTerminal ( cx ) ; cx . setClauseType ( ClauseType . CASE ) ; return ret ; |
public class FeatureTileGraphics { /** * Create a new empty Image and Graphics
* @ param layer
* layer index */
private void createImageAndGraphics ( int layer ) { } } | layeredImage [ layer ] = new BufferedImage ( tileWidth , tileHeight , BufferedImage . TYPE_INT_ARGB ) ; layeredGraphics [ layer ] = layeredImage [ layer ] . createGraphics ( ) ; layeredGraphics [ layer ] . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; |
public class DfuServiceInitiator { /** * Sets the path to the Distribution packet ( ZIP ) or the a ZIP file matching the deprecated naming
* convention .
* @ param path path to the file
* @ return the builder
* @ see # setZip ( Uri )
* @ see # setZip ( int ) */
public DfuServiceInitiator setZip ( @ NonNull final String path ) { } } | return init ( null , path , 0 , DfuBaseService . TYPE_AUTO , DfuBaseService . MIME_TYPE_ZIP ) ; |
public class JMPathOperation { /** * Create directories optional .
* @ param dirPath the dir path
* @ param attrs the attrs
* @ return the optional */
public static Optional < Path > createDirectories ( Path dirPath , FileAttribute < ? > ... attrs ) { } } | debug ( log , "createDirectories" , dirPath , attrs ) ; try { return Optional . of ( Files . createDirectories ( dirPath , attrs ) ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnEmptyOptional ( log , e , "createDirectories" , dirPath ) ; } |
public class GenIncrementalDomCodeVisitor { /** * Generates the content of a { @ code let } or { @ code param } statement . For HTML and attribute
* let / param statements , the generated instructions inside the node are wrapped in a function
* which will be optionally passed to another template and invoked in the correct location . All
* other kinds of let statements are generated as a simple variable . */
private void visitLetParamContentNode ( RenderUnitNode node , String generatedVarName ) { } } | // The html transform step , performed by HtmlContextVisitor , ensures that
// we always have a content kind specified .
checkState ( node . getContentKind ( ) != null ) ; IncrementalDomCodeBuilder jsCodeBuilder = getJsCodeBuilder ( ) ; SanitizedContentKind prevContentKind = jsCodeBuilder . getContentKind ( ) ; jsCodeBuilder . setContentKind ( node . getContentKind ( ) ) ; CodeChunk definition ; VariableDeclaration . Builder builder = VariableDeclaration . builder ( generatedVarName ) ; SanitizedContentKind kind = node . getContentKind ( ) ; if ( kind == SanitizedContentKind . HTML || kind == SanitizedContentKind . ATTRIBUTES ) { Expression constructor ; if ( kind == SanitizedContentKind . HTML ) { constructor = SOY_IDOM_MAKE_HTML ; } else { constructor = SOY_IDOM_MAKE_ATTRIBUTES ; } JsDoc jsdoc = JsDoc . builder ( ) . addParam ( INCREMENTAL_DOM_PARAM_NAME , "incrementaldomlib.IncrementalDomRenderer" ) . build ( ) ; definition = builder . setRhs ( constructor . call ( Expression . arrowFunction ( jsdoc , visitChildrenReturningCodeChunk ( node ) ) ) ) . build ( ) ; } else { // We do our own initialization , so mark it as such .
String outputVarName = generatedVarName + "_output" ; jsCodeBuilder . pushOutputVar ( outputVarName ) . setOutputVarInited ( ) ; definition = Statement . of ( VariableDeclaration . builder ( outputVarName ) . setRhs ( LITERAL_EMPTY_STRING ) . build ( ) , visitChildrenReturningCodeChunk ( node ) , builder . setRhs ( JsRuntime . sanitizedContentOrdainerFunctionForInternalBlocks ( node . getContentKind ( ) ) . call ( id ( outputVarName ) ) ) . build ( ) ) ; jsCodeBuilder . popOutputVar ( ) ; } jsCodeBuilder . setContentKind ( prevContentKind ) ; jsCodeBuilder . append ( definition ) ; |
public class SundialJobScheduler { /** * Creates the Sundial Scheduler
* @ param threadPoolSize the thread pool size used by the scheduler
* @ param annotatedJobsPackageName A comma ( , ) or colon ( : ) can be used to specify multiple packages
* to scan for Jobs .
* @ return */
public static Scheduler createScheduler ( int threadPoolSize , String annotatedJobsPackageName ) throws SundialSchedulerException { } } | if ( scheduler == null ) { try { scheduler = new SchedulerFactory ( ) . getScheduler ( threadPoolSize , annotatedJobsPackageName ) ; } catch ( SchedulerException e ) { throw new SundialSchedulerException ( "COULD NOT CREATE SUNDIAL SCHEDULER!!!" , e ) ; } } return scheduler ; |
public class BundleStringJsonifier { /** * Add a key and its value to the object literal .
* @ param sb
* @ param key
* @ param fullKey */
private void addValuedKey ( final StringBuffer sb , String key , String fullKey ) { } } | sb . append ( getJsonKey ( key ) ) . append ( ":" ) . append ( FUNC ) . append ( JavascriptStringUtil . quote ( bundleValues . get ( fullKey ) . toString ( ) ) ) ; |
public class CmsExtendedWorkflowManager { /** * Checks whether there are resources which have last been modified in a given project . < p >
* @ param project the project which should be checked
* @ return true if there are no resources which have been last modified inside the project
* @ throws CmsException if something goes wrong */
protected boolean isProjectEmpty ( CmsProject project ) throws CmsException { } } | List < CmsResource > resources = m_adminCms . readProjectView ( project . getUuid ( ) , CmsResourceState . STATE_KEEP ) ; return resources . isEmpty ( ) ; |
public class X500Name { /** * Maybe return a preallocated OID , to reduce storage costs
* and speed recognition of common X . 500 attributes . */
static ObjectIdentifier intern ( ObjectIdentifier oid ) { } } | ObjectIdentifier interned = internedOIDs . get ( oid ) ; if ( interned != null ) { return interned ; } internedOIDs . put ( oid , oid ) ; return oid ; |
public class ICalParameters { /** * Sets the CUTYPE ( calendar user type ) parameter value .
* This parameter is used by the { @ link Attendee } property . It defines the
* type of object that the attendee is ( for example , an " individual " or a
* " room " ) .
* @ param calendarUserType the calendar user type or null to remove
* @ see < a href = " http : / / tools . ietf . org / html / rfc5545 # page - 16 " > RFC 5545
* p . 16 < / a > */
public void setCalendarUserType ( CalendarUserType calendarUserType ) { } } | replace ( CUTYPE , ( calendarUserType == null ) ? null : calendarUserType . getValue ( ) ) ; |
public class PolicyAssignmentsInner { /** * Gets a policy assignment by ID .
* When providing a scope for the assigment , use ' / subscriptions / { subscription - id } / ' for subscriptions , ' / subscriptions / { subscription - id } / resourceGroups / { resource - group - name } ' for resource groups , and ' / subscriptions / { subscription - id } / resourceGroups / { resource - group - name } / providers / { resource - provider - namespace } / { resource - type } / { resource - name } ' for resources .
* @ param policyAssignmentId The ID of the policy assignment to get . Use the format ' / { scope } / providers / Microsoft . Authorization / policyAssignments / { policy - assignment - name } ' .
* @ 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 < PolicyAssignmentInner > getByIdAsync ( String policyAssignmentId , final ServiceCallback < PolicyAssignmentInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getByIdWithServiceResponseAsync ( policyAssignmentId ) , serviceCallback ) ; |
public class IonReaderBinaryRawX { /** * reads a varInt after the first byte was read . The first byte is used to specify the sign and - 0 has different
* representation on the protected API that was called
* @ param firstByte last varInt octet */
private int readVarInt ( int firstByte ) throws IOException { } } | // VarInt uses the high - order bit of the last octet as a marker ; some ( but not all ) 5 - byte VarInts can fit
// into a Java int .
// To validate overflows we accumulate the VarInt in a long and then check if it can be represented by an int
// see http : / / amzn . github . io / ion - docs / docs / binary . html # varuint - and - varint - fields
long retValue = 0 ; int b = firstByte ; boolean isNegative = false ; for ( ; ; ) { if ( b < 0 ) throwUnexpectedEOFException ( ) ; if ( ( b & 0x40 ) != 0 ) { isNegative = true ; } retValue = ( b & 0x3F ) ; if ( ( b & 0x80 ) != 0 ) break ; if ( ( b = read ( ) ) < 0 ) throwUnexpectedEOFException ( ) ; retValue = ( retValue << 7 ) | ( b & 0x7F ) ; if ( ( b & 0x80 ) != 0 ) break ; // for the rest , they ' re all the same
if ( ( b = read ( ) ) < 0 ) throwUnexpectedEOFException ( ) ; retValue = ( retValue << 7 ) | ( b & 0x7F ) ; if ( ( b & 0x80 ) != 0 ) break ; // for the rest , they ' re all the same
if ( ( b = read ( ) ) < 0 ) throwUnexpectedEOFException ( ) ; retValue = ( retValue << 7 ) | ( b & 0x7F ) ; if ( ( b & 0x80 ) != 0 ) break ; // for the rest , they ' re all the same
if ( ( b = read ( ) ) < 0 ) throwUnexpectedEOFException ( ) ; retValue = ( retValue << 7 ) | ( b & 0x7F ) ; if ( ( b & 0x80 ) != 0 ) break ; // Don ' t support anything above a 5 - byte VarInt for now , see https : / / github . com / amzn / ion - java / issues / 146
throwVarIntOverflowException ( ) ; } if ( isNegative ) { retValue = - retValue ; } int retValueAsInt = ( int ) retValue ; if ( retValue != ( ( long ) retValueAsInt ) ) { throwVarIntOverflowException ( ) ; } return retValueAsInt ; |
public class Matrix4x3d { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4x3dc # scale ( org . joml . Vector3dc , org . joml . Matrix4x3d ) */
public Matrix4x3d scale ( Vector3dc xyz , Matrix4x3d dest ) { } } | return scale ( xyz . x ( ) , xyz . y ( ) , xyz . z ( ) , dest ) ; |
public class SourceLineAnnotation { /** * Factory method for creating a source line annotation describing an entire
* method .
* @ param methodGen
* the method being visited
* @ return the SourceLineAnnotation , or null if we do not have line number
* information for the method */
public static SourceLineAnnotation fromVisitedMethod ( MethodGen methodGen , String sourceFile ) { } } | LineNumberTable lineNumberTable = methodGen . getLineNumberTable ( methodGen . getConstantPool ( ) ) ; String className = methodGen . getClassName ( ) ; int codeSize = methodGen . getInstructionList ( ) . getLength ( ) ; if ( lineNumberTable == null ) { return createUnknown ( className , sourceFile , 0 , codeSize - 1 ) ; } return forEntireMethod ( className , sourceFile , lineNumberTable , codeSize ) ; |
public class CheckClassAdapter { /** * Checks the type arguments in a class type signature .
* @ param signature
* a string containing the signature that must be checked .
* @ param pos
* index of first character to be checked .
* @ return the index of the first character after the checked part . */
private static int checkTypeArguments ( final String signature , int pos ) { } } | // TypeArguments :
// < TypeArgument + >
pos = checkChar ( '<' , signature , pos ) ; pos = checkTypeArgument ( signature , pos ) ; while ( getChar ( signature , pos ) != '>' ) { pos = checkTypeArgument ( signature , pos ) ; } return pos + 1 ; |
public class DiscordianChronology { /** * Obtains a Discordian local date - time from another date - time object .
* @ param temporal the date - time object to convert , not null
* @ return the Discordian local date - time , not null
* @ throws DateTimeException if unable to create the date - time */
@ Override @ SuppressWarnings ( "unchecked" ) public ChronoLocalDateTime < DiscordianDate > localDateTime ( TemporalAccessor temporal ) { } } | return ( ChronoLocalDateTime < DiscordianDate > ) super . localDateTime ( temporal ) ; |
public class Config { /** * Returns a read - only map { @ link MerkleTreeConfig } for the given name .
* The name is matched by pattern to the configuration and by stripping the
* partition ID qualifier from the given { @ code name } .
* If there is no config found by the name , it will return the configuration
* with the name { @ code default } .
* @ param name name of the map merkle tree config
* @ return the map merkle tree configuration
* @ throws ConfigurationException if ambiguous configurations are found
* @ see StringPartitioningStrategy # getBaseName ( java . lang . String )
* @ see # setConfigPatternMatcher ( ConfigPatternMatcher )
* @ see # getConfigPatternMatcher ( ) */
public MerkleTreeConfig findMapMerkleTreeConfig ( String name ) { } } | name = getBaseName ( name ) ; final MerkleTreeConfig config = lookupByPattern ( configPatternMatcher , mapMerkleTreeConfigs , name ) ; if ( config != null ) { return config . getAsReadOnly ( ) ; } return getMapMerkleTreeConfig ( "default" ) . getAsReadOnly ( ) ; |
public class CrossAppClient { /** * Get all user ' s info ( contains appkey ) of user ' s cross app blacklist
* @ param username Necessary , the owner of blacklist
* @ return UserInfo array
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public UserInfoResult [ ] getCrossBlacklist ( String username ) throws APIConnectionException , APIRequestException { } } | StringUtils . checkUsername ( username ) ; ResponseWrapper response = _httpClient . sendGet ( _baseUrl + crossUserPath + "/" + username + "/blacklist" ) ; return _gson . fromJson ( response . responseContent , UserInfoResult [ ] . class ) ; |
public class WebSocket { /** * Called by the writing thread as its last step . */
void onWritingThreadFinished ( WebSocketFrame closeFrame ) { } } | synchronized ( mThreadsLock ) { mWritingThreadFinished = true ; mClientCloseFrame = closeFrame ; if ( mReadingThreadFinished == false ) { // Wait for the reading thread to finish .
return ; } } // Both the reading thread and the writing thread have finished .
onThreadsFinished ( ) ; |
public class TrustedAdvisorCheckResultMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TrustedAdvisorCheckResult trustedAdvisorCheckResult , ProtocolMarshaller protocolMarshaller ) { } } | if ( trustedAdvisorCheckResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trustedAdvisorCheckResult . getCheckId ( ) , CHECKID_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorCheckResult . getTimestamp ( ) , TIMESTAMP_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorCheckResult . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorCheckResult . getResourcesSummary ( ) , RESOURCESSUMMARY_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorCheckResult . getCategorySpecificSummary ( ) , CATEGORYSPECIFICSUMMARY_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorCheckResult . getFlaggedResources ( ) , FLAGGEDRESOURCES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Utils { /** * Load the specified class , which can be a ( public static ) inner class provided the physical name is used
* ( " my . package . MyClass $ MyInnerClass " ) rather than the canonical name ( " my . package . MyClass . MyInnerClass " )
* @ param className Fully qualified class name
* @ return The loaded Class
* @ throws ClassNotFoundException
* @ throws NoSuchFieldException
* @ throws IllegalAccessException */
public static Class < ? > loadClass ( String className ) throws ClassNotFoundException , NoSuchFieldException , IllegalAccessException { } } | ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; return classLoader . loadClass ( className ) ; |
public class Crossing { /** * Returns how many times ray from point ( x , y ) cross cubic curve */
public static int crossCubic ( float x1 , float y1 , float cx1 , float cy1 , float cx2 , float cy2 , float x2 , float y2 , float x , float y ) { } } | // LEFT / RIGHT / UP / EMPTY
if ( ( x < x1 && x < cx1 && x < cx2 && x < x2 ) || ( x > x1 && x > cx1 && x > cx2 && x > x2 ) || ( y > y1 && y > cy1 && y > cy2 && y > y2 ) || ( x1 == cx1 && cx1 == cx2 && cx2 == x2 ) ) { return 0 ; } // DOWN
if ( y < y1 && y < cy1 && y < cy2 && y < y2 && x != x1 && x != x2 ) { if ( x1 < x2 ) { return x1 < x && x < x2 ? 1 : 0 ; } return x2 < x && x < x1 ? - 1 : 0 ; } // INSIDE
CubicCurveH c = new CubicCurveH ( x1 , y1 , cx1 , cy1 , cx2 , cy2 , x2 , y2 ) ; float px = x - x1 , py = y - y1 ; float [ ] res = new float [ 3 ] ; int rc = c . solvePoint ( res , px ) ; return c . cross ( res , rc , py , py ) ; |
public class PersonGroupPersonsImpl { /** * Retrieve information about a persisted face ( specified by persistedFaceId , personId and its belonging personGroupId ) .
* @ param personGroupId Id referencing a particular person group .
* @ param personId Id referencing a particular person .
* @ param persistedFaceId Id referencing a particular persistedFaceId of an existing face .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PersistedFace object */
public Observable < ServiceResponse < PersistedFace > > getFaceWithServiceResponseAsync ( String personGroupId , UUID personId , UUID persistedFaceId ) { } } | if ( this . client . azureRegion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.azureRegion() is required and cannot be null." ) ; } if ( personGroupId == null ) { throw new IllegalArgumentException ( "Parameter personGroupId is required and cannot be null." ) ; } if ( personId == null ) { throw new IllegalArgumentException ( "Parameter personId is required and cannot be null." ) ; } if ( persistedFaceId == null ) { throw new IllegalArgumentException ( "Parameter persistedFaceId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{AzureRegion}" , this . client . azureRegion ( ) ) ; return service . getFace ( personGroupId , personId , persistedFaceId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < PersistedFace > > > ( ) { @ Override public Observable < ServiceResponse < PersistedFace > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PersistedFace > clientResponse = getFaceDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class PutTelemetryRecordsRequest { /** * @ param telemetryRecords */
public void setTelemetryRecords ( java . util . Collection < TelemetryRecord > telemetryRecords ) { } } | if ( telemetryRecords == null ) { this . telemetryRecords = null ; return ; } this . telemetryRecords = new java . util . ArrayList < TelemetryRecord > ( telemetryRecords ) ; |
public class LogHelper { /** * Check if logging is enabled for the passed class based on the error level
* provider by the passed object
* @ param aLoggingClass
* The class to determine the logger from . May not be < code > null < / code >
* @ param aErrorLevelProvider
* The error level provider . May not be < code > null < / code > .
* @ return < code > true < / code > if the respective log level is allowed ,
* < code > false < / code > if not */
public static boolean isEnabled ( @ Nonnull final Class < ? > aLoggingClass , @ Nonnull final IHasErrorLevel aErrorLevelProvider ) { } } | return isEnabled ( LoggerFactory . getLogger ( aLoggingClass ) , aErrorLevelProvider . getErrorLevel ( ) ) ; |
public class DomeFunctions { /** * Wrapper around the { @ code dateOffset ( ) } method of { @ code org . agmip . common . Functions } .
* @ param m AgMIP simulation description
* @ param var Variable to output
* @ param base Base date to offset
* @ param offset number of days to offset
* @ return dome compatable modification */
public static HashMap < String , ArrayList < String > > dateOffset ( HashMap m , String var , String base , String offset ) { } } | return offset ( m , var , base , offset , true ) ; |
public class ExecutorFilter { /** * Create an EnumSet from an array of EventTypes , and set the associated
* eventTypes field .
* @ param eventTypes The array of handled events */
private void initEventTypes ( IoEventType ... eventTypes ) { } } | if ( ( eventTypes == null ) || ( eventTypes . length == 0 ) ) { eventTypes = DEFAULT_EVENT_SET ; } // Copy the list of handled events in the event set
this . eventTypes = EnumSet . of ( eventTypes [ 0 ] , eventTypes ) ; // Check that we don ' t have the SESSION _ CREATED event in the set
if ( this . eventTypes . contains ( IoEventType . SESSION_CREATED ) ) { this . eventTypes = null ; throw new IllegalArgumentException ( IoEventType . SESSION_CREATED + " is not allowed." ) ; } |
public class UpdateGroupCertificateConfigurationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateGroupCertificateConfigurationRequest updateGroupCertificateConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateGroupCertificateConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateGroupCertificateConfigurationRequest . getCertificateExpiryInMilliseconds ( ) , CERTIFICATEEXPIRYINMILLISECONDS_BINDING ) ; protocolMarshaller . marshall ( updateGroupCertificateConfigurationRequest . getGroupId ( ) , GROUPID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AsciiString { /** * Converts the characters in this string to lowercase , using the default Locale .
* @ return a new string containing the lowercase characters equivalent to the characters in this string . */
public AsciiString toLowerCase ( ) { } } | boolean lowercased = true ; int i , j ; final int len = length ( ) + arrayOffset ( ) ; for ( i = arrayOffset ( ) ; i < len ; ++ i ) { byte b = value [ i ] ; if ( b >= 'A' && b <= 'Z' ) { lowercased = false ; break ; } } // Check if this string does not contain any uppercase characters .
if ( lowercased ) { return this ; } final byte [ ] newValue = PlatformDependent . allocateUninitializedArray ( length ( ) ) ; for ( i = 0 , j = arrayOffset ( ) ; i < newValue . length ; ++ i , ++ j ) { newValue [ i ] = toLowerCase ( value [ j ] ) ; } return new AsciiString ( newValue , false ) ; |
public class GetLogEventsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetLogEventsRequest getLogEventsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getLogEventsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getLogEventsRequest . getLogGroupName ( ) , LOGGROUPNAME_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getLogStreamName ( ) , LOGSTREAMNAME_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getEndTime ( ) , ENDTIME_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( getLogEventsRequest . getStartFromHead ( ) , STARTFROMHEAD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CertificateAuthorityGenerator { /** * The main method for this application . It expects the following arguments :
* < ol >
* < li > The name of the target environment ( e . g . Sandbox , PreProd , Production , etc . ) . < / li >
* < li > The name of the organization that will own the certificate authority ( optional ) . < / li >
* < li > The name of the country in which the organization resides ( optional , but requires organization ) . < / li >
* < / ol >
* @ param args The arguments that were passed into this program . */
static public void main ( String [ ] args ) { } } | String environment = args [ 0 ] ; String organization = args . length > 1 ? args [ 1 ] : "Crater Dog Technologies™" ; String country = args . length > 2 ? args [ 2 ] : "US" ; String filePrefix = environment + "-CA" ; try ( FileOutputStream output = new FileOutputStream ( filePrefix + ".p12" ) ; FileWriter pwFile = new FileWriter ( filePrefix + ".pw" ) ) { logger . info ( "Generating a new key pair for the CA..." ) ; MessageCryptex cryptex = new RsaAesMessageCryptex ( ) ; RsaCertificateManager manager = new RsaCertificateManager ( ) ; KeyPair caKeyPair = cryptex . generateKeyPair ( ) ; PublicKey caPublicKey = caKeyPair . getPublic ( ) ; PrivateKey caPrivateKey = caKeyPair . getPrivate ( ) ; logger . info ( "Generating a self-signed CA certificate..." ) ; StringBuilder subjectBuilder = new StringBuilder ( ) ; subjectBuilder . append ( "CN=" ) ; subjectBuilder . append ( organization ) ; subjectBuilder . append ( " " ) ; subjectBuilder . append ( environment ) ; subjectBuilder . append ( " Private Certificate Authority, O=" ) ; subjectBuilder . append ( organization ) ; subjectBuilder . append ( ", C=" ) ; subjectBuilder . append ( country ) ; String caSubject = subjectBuilder . toString ( ) ; BigInteger caSerialNumber = new BigInteger ( new Tag ( 16 ) . toBytes ( ) ) ; long lifetime = 30L /* years */
* 365L /* days */
* 24L /* hours */
* 60L /* minutes */
* 60L /* seconds */
* 1000L /* milliseconds */
; X509Certificate caCertificate = manager . createCertificateAuthority ( caPrivateKey , caPublicKey , caSubject , caSerialNumber , lifetime ) ; caCertificate . verify ( caPublicKey ) ; logger . info ( "Creating the CA key store..." ) ; char [ ] caPassword = new Tag ( 16 ) . toString ( ) . toCharArray ( ) ; KeyStore caKeyStore = manager . createPkcs12KeyStore ( CA_ALIAS , caPassword , caPrivateKey , caCertificate ) ; logger . info ( "Writing out the key store and password to files..." ) ; manager . saveKeyStore ( output , caKeyStore , caPassword ) ; pwFile . write ( caPassword ) ; } catch ( CertificateException | NoSuchAlgorithmException | InvalidKeyException | NoSuchProviderException | SignatureException | IOException e ) { logger . error ( "An error occurred while attempting to generate the certificate authority:" , e ) ; System . exit ( 1 ) ; } System . exit ( 0 ) ; |
public class SecuritySettingsPlugin { /** * Factory method for that can be used to add additional security configuration to this plugin .
* Overrides should call { @ code super . onConfigure ( ) } .
* @ param application
* the application */
protected void onConfigure ( final WebApplication application ) { } } | set ( application , this ) ; application . getRequestCycleListeners ( ) . add ( new AbstractRequestCycleListener ( ) { @ Override public void onBeginRequest ( final RequestCycle cycle ) { super . onBeginRequest ( cycle ) ; final WebResponse response = ( WebResponse ) cycle . getResponse ( ) ; // Category : Framing
WicketComponentExtensions . setSecurityFramingHeaders ( response ) ; // Category : Transport
WicketComponentExtensions . setSecurityTransportHeaders ( response ) ; // Category : XSS
WicketComponentExtensions . setSecurityXSSHeaders ( response ) ; // Category : Caching
WicketComponentExtensions . setSecurityCachingHeaders ( response ) ; } } ) ; |
public class SubnetsInner { /** * Creates or updates a subnet in the specified virtual network .
* @ param resourceGroupName The name of the resource group .
* @ param virtualNetworkName The name of the virtual network .
* @ param subnetName The name of the subnet .
* @ param subnetParameters Parameters supplied to the create or update subnet operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the SubnetInner object if successful . */
public SubnetInner createOrUpdate ( String resourceGroupName , String virtualNetworkName , String subnetName , SubnetInner subnetParameters ) { } } | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , virtualNetworkName , subnetName , subnetParameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class XmlUtil { /** * Return the value of the named attribute of the given element .
* @ param el Element
* @ param name String name of desired attribute
* @ return String attribute value or null
* @ throws SAXException */
public static String getAttrVal ( final Element el , final String name ) throws SAXException { } } | Attr at = el . getAttributeNode ( name ) ; if ( at == null ) { return null ; } return at . getValue ( ) ; |
public class TSIG { /** * Generates a TSIG record with a specific error for a message and adds it
* to the message .
* @ param m The message
* @ param error The error
* @ param old If this message is a response , the TSIG from the request */
public void apply ( Message m , int error , TSIGRecord old ) { } } | Record r = generate ( m , m . toWire ( ) , error , old ) ; m . addRecord ( r , Section . ADDITIONAL ) ; m . tsigState = Message . TSIG_SIGNED ; |
public class Optionals { /** * Gets the value of an optional , throwing an exception if no value is present . This can be more convenient than using { @ link Optional # orElseThrow ( Supplier ) } . < p > E . g . instead of doing :
* < pre >
* final Optional & lt ; Integer & gt ; opt = Optional . of ( 1 ) ;
* final Integer value = opt . orElseThrow ( ( ) - & gt ; new IllegalArgumentException ( ) ) ;
* < / pre >
* we can do :
* < pre >
* final Optional & lt ; Integer & gt ; opt = Optional . of ( 1 ) ;
* final Integer value = Optionals . required ( opt ) ;
* < / pre >
* Another example is ot insert informative exceptions on missing values in a stream :
* < pre >
* final Stream & lt ; Optional & lt ; T & gt ; & gt ; optStream = . . . ;
* final Stream & lt ; T & gt ; stream = optStream . map ( t - & gt ; Optionals . required ( t ) ) ;
* < / pre >
* @ param optional
* the optional to get the value from
* @ param < T >
* the type of the value
* @ return the value of the optional
* @ throws IllegalArgumentValidationException
* if no value is present */
public static < T > T required ( final Optional < T > optional ) { } } | notNull ( optional ) ; isTrue ( optional . isPresent ( ) , "No value present" ) ; return optional . get ( ) ; |
public class ContentPropertiesFileReader { /** * ( non - Javadoc )
* @ see org . springframework . batch . item . ItemReader # read ( ) */
@ Override public synchronized ContentProperties read ( ) throws Exception , UnexpectedInputException , ParseException , NonTransientResourceException { } } | if ( jParser == null ) { JsonFactory jfactory = new JsonFactory ( ) ; jParser = jfactory . createJsonParser ( this . propertiesFile ) ; jParser . nextToken ( ) ; // skips the first [
// skip properties already read .
int itemsRead = ( int ) getItemsRead ( ) ; for ( int i = 0 ; i < itemsRead ; i ++ ) { doRead ( ) ; } } return doRead ( ) ; |
public class ProxyTerminationInfo { /** * ( non - Javadoc )
* @ see java . io . Externalizable # readExternal ( java . io . ObjectInput ) */
public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | try { calleeCSeq = in . readLong ( ) ; callerCSeq = in . readLong ( ) ; calleeContact = SipFactoryImpl . addressFactory . createURI ( in . readUTF ( ) ) ; callerContact = SipFactoryImpl . addressFactory . createURI ( in . readUTF ( ) ) ; int routeSetSize = in . readInt ( ) ; for ( int i = 0 ; i < routeSetSize ; i ++ ) { javax . sip . address . Address route = SipFactoryImpl . addressFactory . createAddress ( in . readUTF ( ) ) ; callerRouteSet . add ( route ) ; } routeSetSize = in . readInt ( ) ; for ( int i = 0 ; i < routeSetSize ; i ++ ) { javax . sip . address . Address route = SipFactoryImpl . addressFactory . createAddress ( in . readUTF ( ) ) ; calleeRouteSet . add ( route ) ; } javax . sip . address . Address toAddress = SipFactoryImpl . addressFactory . createAddress ( in . readUTF ( ) ) ; toHeader = ( To ) SipFactoryImpl . headerFactory . createToHeader ( toAddress , in . readUTF ( ) ) ; javax . sip . address . Address fromAddress = SipFactoryImpl . addressFactory . createAddress ( in . readUTF ( ) ) ; fromHeader = ( From ) SipFactoryImpl . headerFactory . createFromHeader ( fromAddress , in . readUTF ( ) ) ; callId = in . readUTF ( ) ; } catch ( ParseException e ) { throw new IllegalArgumentException ( "Problem occurred while unserializing ProxyTerminationInfo" , e ) ; } |
public class CmsPreferences { /** * Builds the HTML for the start galleries settings as select boxes . < p >
* @ param htmlAttributes optional HTML attributes for the & lgt ; select & gt ; tag
* @ return the HTML for start galleries select boxes */
public String buildSelectStartGalleries ( String htmlAttributes ) { } } | StringBuffer result = new StringBuffer ( 1024 ) ; HttpServletRequest request = getJsp ( ) . getRequest ( ) ; // set the attributes for the select tag
if ( htmlAttributes != null ) { htmlAttributes += " name=\"" + PARAM_STARTGALLERY_PREFIX ; } Map < String , A_CmsAjaxGallery > galleriesTypes = OpenCms . getWorkplaceManager ( ) . getGalleries ( ) ; if ( galleriesTypes != null ) { // sort the galleries by localized name
Map < String , String > localizedGalleries = new TreeMap < String , String > ( ) ; for ( Iterator < String > i = galleriesTypes . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String currentGalleryType = i . next ( ) ; String localizedName = CmsWorkplaceMessages . getResourceTypeName ( this , currentGalleryType ) ; localizedGalleries . put ( localizedName , currentGalleryType ) ; } for ( Iterator < Map . Entry < String , String > > i = localizedGalleries . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry < String , String > entry = i . next ( ) ; // first : retrieve the gallery type
String currentGalleryType = entry . getValue ( ) ; // second : retrieve the gallery type id
int currentGalleryTypeId = 0 ; try { currentGalleryTypeId = OpenCms . getResourceManager ( ) . getResourceType ( currentGalleryType ) . getTypeId ( ) ; } catch ( CmsLoaderException e ) { // resource type not found , log error
if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } continue ; } // third : get the available galleries for this gallery type id
List < CmsResource > availableGalleries = A_CmsAjaxGallery . getGalleries ( currentGalleryTypeId , getCms ( ) ) ; // forth : fill the select box
List < String > options = new ArrayList < String > ( availableGalleries . size ( ) + 2 ) ; List < String > values = new ArrayList < String > ( availableGalleries . size ( ) + 2 ) ; options . add ( key ( Messages . GUI_PREF_STARTGALLERY_PRESELECT_0 ) ) ; values . add ( INPUT_DEFAULT ) ; options . add ( key ( Messages . GUI_PREF_STARTGALLERY_NONE_0 ) ) ; values . add ( INPUT_NONE ) ; String savedValue = computeStartGalleryPreselection ( request , currentGalleryType ) ; int counter = 2 ; int selectedIndex = 0 ; Iterator < CmsResource > iGalleries = availableGalleries . iterator ( ) ; while ( iGalleries . hasNext ( ) ) { CmsResource res = iGalleries . next ( ) ; String rootPath = res . getRootPath ( ) ; String sitePath = getCms ( ) . getSitePath ( res ) ; // select the value
if ( ( savedValue != null ) && ( savedValue . equals ( rootPath ) ) ) { selectedIndex = counter ; } counter ++ ; // gallery title
String title = "" ; try { // read the gallery title
title = getCms ( ) . readPropertyObject ( sitePath , CmsPropertyDefinition . PROPERTY_TITLE , false ) . getValue ( "" ) ; } catch ( CmsException e ) { // error reading title property
if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } options . add ( title . concat ( " (" ) . concat ( sitePath ) . concat ( ")" ) ) ; values . add ( rootPath ) ; } // select the value
if ( ( savedValue != null ) && savedValue . equals ( INPUT_NONE ) ) { selectedIndex = 1 ; } // create the table row for the current resource type
result . append ( "<tr>\n\t<td style=\"white-space: nowrap;\">" ) ; result . append ( entry . getKey ( ) ) ; result . append ( "</td>\n\t<td>" ) ; result . append ( buildSelect ( htmlAttributes + currentGalleryType + "\"" , options , values , selectedIndex ) ) ; result . append ( "</td>\n</tr>\n" ) ; } } return result . toString ( ) ; |
public class ExpandableExtension { /** * collapses all expanded items
* @ param notifyItemChanged true if we need to call notifyItemChanged . DEFAULT : false */
public void collapse ( boolean notifyItemChanged ) { } } | int [ ] expandedItems = getExpandedItems ( ) ; for ( int i = expandedItems . length - 1 ; i >= 0 ; i -- ) { collapse ( expandedItems [ i ] , notifyItemChanged ) ; } |
public class StreamingRepairTask { /** * If we failed on either stream in or out , reply fail to the initiator . */
public void onFailure ( Throwable t ) { } } | MessagingService . instance ( ) . sendOneWay ( new SyncComplete ( desc , request . src , request . dst , false ) . createMessage ( ) , request . initiator ) ; |
public class Bot { /** * Encode the text before sending to Slack .
* Learn < a href = " https : / / api . slack . com / docs / formatting " > more on message formatting in Slack < / a >
* @ param message to encode
* @ return encoded message */
private String encode ( String message ) { } } | return message == null ? null : message . replace ( "&" , "&" ) . replace ( "<" , "<" ) . replace ( ">" , ">" ) ; |
public class RealWebSocket { /** * Attempts to remove a single frame from a queue and send it . This prefers to write urgent pongs
* before less urgent messages and close frames . For example it ' s possible that a caller will
* enqueue messages followed by pongs , but this sends pongs followed by messages . Pongs are always
* written in the order they were enqueued .
* < p > If a frame cannot be sent - because there are none enqueued or because the web socket is not
* connected - this does nothing and returns false . Otherwise this returns true and the caller
* should immediately invoke this method again until it returns false .
* < p > This method may only be invoked by the writer thread . There may be only thread invoking this
* method at a time . */
boolean writeOneFrame ( ) throws IOException { } } | WebSocketWriter writer ; ByteString pong ; Object messageOrClose = null ; int receivedCloseCode = - 1 ; String receivedCloseReason = null ; Streams streamsToClose = null ; synchronized ( RealWebSocket . this ) { if ( failed ) { return false ; // Failed web socket .
} writer = this . writer ; pong = pongQueue . poll ( ) ; if ( pong == null ) { messageOrClose = messageAndCloseQueue . poll ( ) ; if ( messageOrClose instanceof Close ) { receivedCloseCode = this . receivedCloseCode ; receivedCloseReason = this . receivedCloseReason ; if ( receivedCloseCode != - 1 ) { streamsToClose = this . streams ; this . streams = null ; this . executor . shutdown ( ) ; } else { // When we request a graceful close also schedule a cancel of the websocket .
cancelFuture = executor . schedule ( new CancelRunnable ( ) , ( ( Close ) messageOrClose ) . cancelAfterCloseMillis , MILLISECONDS ) ; } } else if ( messageOrClose == null ) { return false ; // The queue is exhausted .
} } } try { if ( pong != null ) { writer . writePong ( pong ) ; } else if ( messageOrClose instanceof Message ) { ByteString data = ( ( Message ) messageOrClose ) . data ; BufferedSink sink = Okio . buffer ( writer . newMessageSink ( ( ( Message ) messageOrClose ) . formatOpcode , data . size ( ) ) ) ; sink . write ( data ) ; sink . close ( ) ; synchronized ( this ) { queueSize -= data . size ( ) ; } } else if ( messageOrClose instanceof Close ) { Close close = ( Close ) messageOrClose ; writer . writeClose ( close . code , close . reason ) ; // We closed the writer : now both reader and writer are closed .
if ( streamsToClose != null ) { listener . onClosed ( this , receivedCloseCode , receivedCloseReason ) ; } } else { throw new AssertionError ( ) ; } return true ; } finally { closeQuietly ( streamsToClose ) ; } |
public class ContainerStateMonitor { /** * Log a report of any problematic container state changes and reset container state change history
* so another run of this method or of { @ link # awaitContainerStateChangeReport ( long , java . util . concurrent . TimeUnit ) }
* will produce a report not including any changes included in a report returned by this run . */
void logContainerStateChangesAndReset ( ) { } } | ContainerStateChangeReport changeReport = createContainerStateChangeReport ( true ) ; if ( changeReport != null ) { final String msg = createChangeReportLogMessage ( changeReport , false ) ; ROOT_LOGGER . info ( msg ) ; } |
public class MenuUtil { /** * Recursively remove empty menu container elements . This is done after removing menu items to
* keep the menu structure lean .
* @ param parent The starting menu container . */
public static void pruneMenus ( BaseComponent parent ) { } } | while ( parent != null && parent instanceof BaseMenuComponent ) { if ( parent . getChildren ( ) . isEmpty ( ) ) { BaseComponent newParent = parent . getParent ( ) ; parent . destroy ( ) ; parent = newParent ; } else { break ; } } |
public class Money { /** * Obtains an instance of { @ code Money } from an amount in minor units .
* For example , { @ code ofMinor ( USD , 1234 , 2 ) } creates the instance { @ code USD 12.34 } .
* @ param currency the currency , not null
* @ param amountMinor the amount of money in the minor division of the currency
* @ param factionDigits number of digits
* @ return the monetary amount from minor units
* @ see CurrencyUnit # getDefaultFractionDigits ( )
* @ see Money # ofMinor ( CurrencyUnit , long , int )
* @ throws NullPointerException when the currency is null
* @ throws IllegalArgumentException when the factionDigits is negative
* @ since 1.0.1 */
public static Money ofMinor ( CurrencyUnit currency , long amountMinor , int factionDigits ) { } } | if ( factionDigits < 0 ) { throw new IllegalArgumentException ( "The factionDigits cannot be negative" ) ; } return of ( BigDecimal . valueOf ( amountMinor , factionDigits ) , currency ) ; |
public class NestedJarHandler { /** * Download a jar from a URL to a temporary file .
* @ param jarURL
* the jar URL
* @ param log
* the log
* @ return the temporary file the jar was downloaded to */
private File downloadTempFile ( final String jarURL , final LogNode log ) { } } | final LogNode subLog = log == null ? null : log . log ( jarURL , "Downloading URL " + jarURL ) ; File tempFile ; try { tempFile = makeTempFile ( jarURL , /* onlyUseLeafname = */
true ) ; final URL url = new URL ( jarURL ) ; try ( InputStream inputStream = url . openStream ( ) ) { Files . copy ( inputStream , tempFile . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) ; } if ( subLog != null ) { subLog . addElapsedTime ( ) ; } } catch ( final IOException | SecurityException e ) { if ( subLog != null ) { subLog . log ( "Could not download " + jarURL , e ) ; } return null ; } if ( subLog != null ) { subLog . log ( "Downloaded to temporary file " + tempFile ) ; subLog . log ( "***** Note that it is time-consuming to scan jars at http(s) addresses, " + "they must be downloaded for every scan, and the same jars must also be " + "separately downloaded by the ClassLoader *****" ) ; } return tempFile ; |
public class BufferedReaderBytesRead { /** * Skips characters .
* @ param n The number of characters to skip
* @ return The number of characters actually skipped
* @ exception IllegalArgumentException If < code > n < / code > is negative .
* @ exception IOException If an I / O error occurs */
@ Override public long skip ( long n ) throws IOException { } } | if ( n < 0L ) { throw new IllegalArgumentException ( "skip value is negative" ) ; } synchronized ( lock ) { ensureOpen ( ) ; long r = n ; while ( r > 0 ) { if ( nextChar >= nChars ) { fill ( ) ; } if ( nextChar >= nChars ) /* EOF */
{ break ; } if ( skipLF ) { skipLF = false ; if ( cb [ nextChar ] == '\n' ) { nextChar ++ ; } } long d = nChars - nextChar ; if ( r <= d ) { nextChar += r ; r = 0 ; break ; } else { r -= d ; nextChar = nChars ; } } bytesRead = bytesRead + ( n - r ) ; return n - r ; } |
public class ClassCacheUtils { /** * Check if a unique method name exists in class , if exist return the method ,
* otherwise return null */
public static Method checkMethodExist ( Class < ? > clazz , String uniqueMethodName ) { } } | if ( clazz == null || StrUtils . isEmpty ( uniqueMethodName ) ) return null ; Map < String , Object > methodMap = uniqueMethodCache . get ( clazz ) ; if ( methodMap != null && ! methodMap . isEmpty ( ) ) { Object result = methodMap . get ( uniqueMethodName ) ; if ( result != null ) { if ( ClassOrMethodNotExist . class . equals ( result ) ) return null ; else return ( Method ) result ; } } if ( methodMap == null ) { methodMap = new HashMap < String , Object > ( ) ; uniqueMethodCache . put ( clazz , methodMap ) ; } Method [ ] methods = clazz . getMethods ( ) ; for ( Method method : methods ) if ( uniqueMethodName != null && uniqueMethodName . equals ( method . getName ( ) ) ) { methodMap . put ( uniqueMethodName , method ) ; return method ; } methodMap . put ( uniqueMethodName , ClassOrMethodNotExist . class ) ; return null ; |
public class RestApiClient { /** * Adds the user to group .
* @ param username the username
* @ param groupName the group name
* @ return the response */
public Response addUserToGroup ( String username , String groupName ) { } } | return restClient . post ( "users/" + username + "/groups/" + groupName , null , new HashMap < String , String > ( ) ) ; |
public class Weld { /** * Extensions to Weld SE can subclass and override this method to customize the deployment before weld boots up . For example , to add a custom
* ResourceLoader , you would subclass Weld like so :
* < pre >
* public class MyWeld extends Weld {
* protected Deployment createDeployment ( ResourceLoader resourceLoader , CDI11Bootstrap bootstrap ) {
* return super . createDeployment ( new MyResourceLoader ( ) , bootstrap ) ;
* < / pre >
* This could then be used as normal :
* < pre >
* WeldContainer container = new MyWeld ( ) . initialize ( ) ;
* < / pre >
* @ param resourceLoader
* @ param bootstrap */
protected Deployment createDeployment ( ResourceLoader resourceLoader , CDI11Bootstrap bootstrap ) { } } | final Iterable < Metadata < Extension > > extensions = getExtensions ( ) ; final TypeDiscoveryConfiguration typeDiscoveryConfiguration = bootstrap . startExtensions ( extensions ) ; final Deployment deployment ; final Set < WeldBeanDeploymentArchive > beanDeploymentArchives = new HashSet < WeldBeanDeploymentArchive > ( ) ; final Map < Class < ? extends Service > , Service > additionalServices = new HashMap < > ( this . additionalServices ) ; final Set < Class < ? extends Annotation > > beanDefiningAnnotations = ImmutableSet . < Class < ? extends Annotation > > builder ( ) . addAll ( typeDiscoveryConfiguration . getKnownBeanDefiningAnnotations ( ) ) // Add ThreadScoped manually as Weld SE doesn ' t support implicit bean archives without beans . xml
. add ( ThreadScoped . class ) // Add all custom bean defining annotations user registered via Weld . addBeanDefiningAnnotations ( )
. addAll ( extendedBeanDefiningAnnotations ) . build ( ) ; if ( discoveryEnabled ) { DiscoveryStrategy strategy = DiscoveryStrategyFactory . create ( resourceLoader , bootstrap , beanDefiningAnnotations , isEnabled ( Jandex . DISABLE_JANDEX_DISCOVERY_STRATEGY , false ) ) ; if ( isImplicitScanEnabled ( ) ) { strategy . setScanner ( new ClassPathBeanArchiveScanner ( bootstrap ) ) ; } beanDeploymentArchives . addAll ( strategy . performDiscovery ( ) ) ; ClassFileServices classFileServices = strategy . getClassFileServices ( ) ; if ( classFileServices != null ) { additionalServices . put ( ClassFileServices . class , classFileServices ) ; } } if ( isSyntheticBeanArchiveRequired ( ) ) { ImmutableSet . Builder < String > beanClassesBuilder = ImmutableSet . builder ( ) ; beanClassesBuilder . addAll ( scanPackages ( ) ) ; Set < String > setOfAllBeanClasses = beanClassesBuilder . build ( ) ; // the creation process differs based on bean discovery mode
if ( BeanDiscoveryMode . ANNOTATED . equals ( beanDiscoveryMode ) ) { // Annotated bean discovery mode , filter classes
ImmutableSet . Builder < String > filteredSetbuilder = ImmutableSet . builder ( ) ; for ( String className : setOfAllBeanClasses ) { Class < ? > clazz = Reflections . loadClass ( resourceLoader , className ) ; if ( clazz != null && Reflections . hasBeanDefiningAnnotation ( clazz , beanDefiningAnnotations ) ) { filteredSetbuilder . add ( className ) ; } } setOfAllBeanClasses = filteredSetbuilder . build ( ) ; } WeldBeanDeploymentArchive syntheticBeanArchive = new WeldBeanDeploymentArchive ( WeldDeployment . SYNTHETIC_BDA_ID , setOfAllBeanClasses , null , buildSyntheticBeansXml ( ) , Collections . emptySet ( ) , ImmutableSet . copyOf ( beanClasses ) ) ; beanDeploymentArchives . add ( syntheticBeanArchive ) ; } if ( beanDeploymentArchives . isEmpty ( ) && this . containerLifecycleObservers . isEmpty ( ) && this . extensions . isEmpty ( ) ) { throw WeldSELogger . LOG . weldContainerCannotBeInitializedNoBeanArchivesFound ( ) ; } Multimap < String , BeanDeploymentArchive > problems = BeanArchives . findBeanClassesDeployedInMultipleBeanArchives ( beanDeploymentArchives ) ; if ( ! problems . isEmpty ( ) ) { // Right now , we only log a warning for each bean class deployed in multiple bean archives
for ( Entry < String , Collection < BeanDeploymentArchive > > entry : problems . entrySet ( ) ) { WeldSELogger . LOG . beanClassDeployedInMultipleBeanArchives ( entry . getKey ( ) , WeldCollections . toMultiRowString ( entry . getValue ( ) ) ) ; } } if ( isEnabled ( ARCHIVE_ISOLATION_SYSTEM_PROPERTY , true ) ) { deployment = new WeldDeployment ( resourceLoader , bootstrap , beanDeploymentArchives , extensions ) ; CommonLogger . LOG . archiveIsolationEnabled ( ) ; } else { Set < WeldBeanDeploymentArchive > flatDeployment = new HashSet < WeldBeanDeploymentArchive > ( ) ; flatDeployment . add ( WeldBeanDeploymentArchive . merge ( bootstrap , beanDeploymentArchives ) ) ; deployment = new WeldDeployment ( resourceLoader , bootstrap , flatDeployment , extensions ) ; CommonLogger . LOG . archiveIsolationDisabled ( ) ; } // Register additional services if a service with higher priority not present
for ( Entry < Class < ? extends Service > , Service > entry : additionalServices . entrySet ( ) ) { Services . put ( deployment . getServices ( ) , entry . getKey ( ) , entry . getValue ( ) ) ; } return deployment ; |
public class JSchema { /** * called on it . */
private JMFType findChild ( JMFType start , String segment ) { } } | if ( start instanceof JSPrimitive || start instanceof JSDynamic || start instanceof JSEnum ) return null ; if ( segment . charAt ( 0 ) == '[' ) return findChildByIndex ( start , Integer . parseInt ( segment . substring ( 1 , segment . length ( ) - 1 ) ) ) ; if ( start instanceof JSVariant ) return findVariantChildByName ( ( JSVariant ) start , segment ) ; else return findTupleChildByName ( ( JSTuple ) start , segment ) ; |
public class ConfigManager { /** * Stop the background thread that reload the config file */
void stopReload ( ) throws InterruptedException { } } | if ( reloadThread != null ) { running = false ; reloadThread . interrupt ( ) ; reloadThread . join ( ) ; reloadThread = null ; } |
public class AttributeValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setAttVal ( String newAttVal ) { } } | String oldAttVal = attVal ; attVal = newAttVal ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . ATTRIBUTE_VALUE__ATT_VAL , oldAttVal , attVal ) ) ; |
public class DataWriterUtil { /** * The function to convert a date into a string according to the format used .
* @ param currentDate the date to convert .
* @ param dateFormat the formatter to convert date element into string .
* @ return the string that corresponds to the date in the format used . */
private static String convertDateElementToString ( Date currentDate , SimpleDateFormat dateFormat ) { } } | return currentDate . getTime ( ) != 0 ? dateFormat . format ( currentDate . getTime ( ) ) : "" ; |
public class Expressions { /** * Creates an BooleanIsLessThan expression from the given expression and constant .
* @ param left The left expression .
* @ param constant The constant to compare to ( must be a Number ) .
* @ throws IllegalArgumentException If the constant is not a Number
* @ return A new is less than binary expression . */
public static BooleanIsLessThan isLessThan ( BooleanExpression left , Object constant ) { } } | if ( ! ( constant instanceof Boolean ) ) throw new IllegalArgumentException ( "constant is not a Boolean" ) ; return new BooleanIsLessThan ( left , constant ( ( Boolean ) constant ) ) ; |
public class AbstractServiceValidateController { /** * Handle ticket validation model and view .
* @ param request the request
* @ param service the service
* @ param serviceTicketId the service ticket id
* @ return the model and view */
protected ModelAndView handleTicketValidation ( final HttpServletRequest request , final WebApplicationService service , final String serviceTicketId ) { } } | var proxyGrantingTicketId = ( TicketGrantingTicket ) null ; val serviceCredential = getServiceCredentialsFromRequest ( service , request ) ; if ( serviceCredential != null ) { try { proxyGrantingTicketId = handleProxyGrantingTicketDelivery ( serviceTicketId , serviceCredential ) ; } catch ( final AuthenticationException e ) { LOGGER . warn ( "Failed to authenticate service credential [{}]" , serviceCredential ) ; return generateErrorView ( CasProtocolConstants . ERROR_CODE_INVALID_PROXY_CALLBACK , new Object [ ] { serviceCredential . getId ( ) } , request , service ) ; } catch ( final InvalidTicketException e ) { LOGGER . error ( "Failed to create proxy granting ticket due to an invalid ticket for [{}]" , serviceCredential , e ) ; return generateErrorView ( e . getCode ( ) , new Object [ ] { serviceTicketId } , request , service ) ; } catch ( final AbstractTicketException e ) { LOGGER . error ( "Failed to create proxy granting ticket for [{}]" , serviceCredential , e ) ; return generateErrorView ( e . getCode ( ) , new Object [ ] { serviceCredential . getId ( ) } , request , service ) ; } } val assertion = validateServiceTicket ( service , serviceTicketId ) ; if ( ! validateAssertion ( request , serviceTicketId , assertion , service ) ) { return generateErrorView ( CasProtocolConstants . ERROR_CODE_INVALID_TICKET , new Object [ ] { serviceTicketId } , request , service ) ; } val ctxResult = serviceValidateConfigurationContext . getRequestedContextValidator ( ) . validateAuthenticationContext ( assertion , request ) ; if ( ! ctxResult . getKey ( ) ) { throw new UnsatisfiedAuthenticationContextTicketValidationException ( assertion . getService ( ) ) ; } var proxyIou = StringUtils . EMPTY ; val proxyHandler = serviceValidateConfigurationContext . getProxyHandler ( ) ; if ( serviceCredential != null && proxyHandler != null && proxyHandler . canHandle ( serviceCredential ) ) { proxyIou = handleProxyIouDelivery ( serviceCredential , proxyGrantingTicketId ) ; if ( StringUtils . isEmpty ( proxyIou ) ) { return generateErrorView ( CasProtocolConstants . ERROR_CODE_INVALID_PROXY_CALLBACK , new Object [ ] { serviceCredential . getId ( ) } , request , service ) ; } } else { LOGGER . debug ( "No service credentials specified, and/or the proxy handler [{}] cannot handle credentials" , proxyHandler ) ; } onSuccessfulValidation ( serviceTicketId , assertion ) ; LOGGER . debug ( "Successfully validated service ticket [{}] for service [{}]" , serviceTicketId , service . getId ( ) ) ; return generateSuccessView ( assertion , proxyIou , service , request , ctxResult . getValue ( ) , proxyGrantingTicketId ) ; |
public class AdductFormula { /** * True , if the AdductFormula contains the given IIsotope object and not
* the instance . The method looks for other isotopes which has the same
* symbol , natural abundance and exact mass .
* @ param isotope The IIsotope this AdductFormula is searched for
* @ return True , if the AdductFormula contains the given isotope object */
@ Override public boolean contains ( IIsotope isotope ) { } } | for ( Iterator < IIsotope > it = isotopes ( ) . iterator ( ) ; it . hasNext ( ) ; ) { IIsotope thisIsotope = it . next ( ) ; if ( isTheSame ( thisIsotope , isotope ) ) { return true ; } } return false ; |
public class ConvertImage { /** * Converts a { @ link InterleavedF32 } into a { @ link GrayF32 } by computing the average value of each pixel
* across all the bands .
* @ param input ( Input ) The ImageInterleaved that is being converted . Not modified .
* @ param output ( Optional ) The single band output image . If null a new image is created . Modified .
* @ return Converted image . */
public static GrayF32 average ( InterleavedF32 input , GrayF32 output ) { } } | if ( output == null ) { output = new GrayF32 ( input . width , input . height ) ; } else { output . reshape ( input . width , input . height ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ConvertInterleavedToSingle_MT . average ( input , output ) ; } else { ConvertInterleavedToSingle . average ( input , output ) ; } return output ; |
public class UriEscape { /** * Perform am URI path segment < strong > unescape < / strong > operation
* on a < tt > char [ ] < / tt > input using < tt > UTF - 8 < / tt > as encoding .
* This method will unescape every percent - encoded ( < tt > % HH < / tt > ) sequences present in input ,
* even for those characters that do not need to be percent - encoded in this context ( unreserved characters
* can be percent - encoded even if / when this is not required , though it is not generally considered a
* good practice ) .
* This method will use < tt > UTF - 8 < / tt > in order to determine the characters specified in the
* percent - encoded byte sequences .
* This method is < strong > thread - safe < / strong > .
* @ param text the < tt > char [ ] < / tt > to be unescaped .
* @ param offset the position in < tt > text < / tt > at which the escape operation should start .
* @ param len the number of characters in < tt > text < / tt > that should be escaped .
* @ param writer the < tt > java . io . Writer < / tt > to which the unescaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ throws IOException if an input / output exception occurs */
public static void unescapeUriPathSegment ( final char [ ] text , final int offset , final int len , final Writer writer ) throws IOException { } } | unescapeUriPathSegment ( text , offset , len , writer , DEFAULT_ENCODING ) ; |
public class MessageProcessorControl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPMessageProcessorControllable # getRemoteTopicSpaceControllables */
public SIMPIterator getRemoteTopicSpaceControllables ( ) { } } | LinkedList remoteTopics = new LinkedList ( ) ; SIMPIterator topics = this . getTopicSpaceIterator ( ) ; while ( topics . hasNext ( ) ) { SIMPTopicSpaceControllable topicSpace = ( SIMPTopicSpaceControllable ) topics . next ( ) ; SIMPIterator currentRemoteTopics = topicSpace . getRemoteTopicSpaceIterator ( ) ; while ( currentRemoteTopics . hasNext ( ) ) { remoteTopics . add ( currentRemoteTopics . next ( ) ) ; } } return new BasicSIMPIterator ( remoteTopics . iterator ( ) ) ; |
public class Shape { /** * Check if this polygon contains the given point
* @ param x The x position of the point to check
* @ param y The y position of the point to check
* @ return True if the point is contained in the polygon */
public boolean contains ( float x , float y ) { } } | checkPoints ( ) ; if ( points . length == 0 ) { return false ; } boolean result = false ; float xnew , ynew ; float xold , yold ; float x1 , y1 ; float x2 , y2 ; int npoints = points . length ; xold = points [ npoints - 2 ] ; yold = points [ npoints - 1 ] ; for ( int i = 0 ; i < npoints ; i += 2 ) { xnew = points [ i ] ; ynew = points [ i + 1 ] ; if ( xnew > xold ) { x1 = xold ; x2 = xnew ; y1 = yold ; y2 = ynew ; } else { x1 = xnew ; x2 = xold ; y1 = ynew ; y2 = yold ; } if ( ( xnew < x ) == ( x <= xold ) /* edge " open " at one end */
&& ( ( double ) y - ( double ) y1 ) * ( x2 - x1 ) < ( ( double ) y2 - ( double ) y1 ) * ( x - x1 ) ) { result = ! result ; } xold = xnew ; yold = ynew ; } return result ; |
public class StatelessStorageProviderImpl { /** * { @ inheritDoc } */
public Iterator < String > getSpaces ( StorageProvider targetProvider , String storeId ) throws StorageException { } } | return targetProvider . getSpaces ( ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCurtainWallType ( ) { } } | if ( ifcCurtainWallTypeEClass == null ) { ifcCurtainWallTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 160 ) ; } return ifcCurtainWallTypeEClass ; |
public class HelpFormatter { /** * Remove the trailing whitespace from the specified String .
* @ param s The String to remove the trailing padding from .
* @ return The String of without the trailing padding */
protected String rtrim ( String s ) { } } | if ( s == null || s . length ( ) == 0 ) { return s ; } int pos = s . length ( ) ; while ( pos > 0 && Character . isWhitespace ( s . charAt ( pos - 1 ) ) ) { -- pos ; } return s . substring ( 0 , pos ) ; |
public class ApiOvhPackxdsl { /** * Get the available domains
* REST : GET / pack / xdsl / { packName } / siteBuilderStart / options / domains
* @ param packName [ required ] The internal name of your pack */
public ArrayList < OvhSiteBuilderDomain > packName_siteBuilderStart_options_domains_GET ( String packName ) throws IOException { } } | String qPath = "/pack/xdsl/{packName}/siteBuilderStart/options/domains" ; StringBuilder sb = path ( qPath , packName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t9 ) ; |
public class RTMPProtocolDecoder { /** * { @ inheritDoc } */
public Unknown decodeUnknown ( byte dataType , IoBuffer in ) { } } | if ( log . isDebugEnabled ( ) ) { log . debug ( "decodeUnknown: {}" , dataType ) ; } return new Unknown ( dataType , in ) ; |
public class SVGHyperCube { /** * Wireframe hypercube .
* @ param svgp SVG Plot
* @ param proj Visualization projection
* @ param box Bounding box
* @ return path element */
public static Element drawFrame ( SVGPlot svgp , Projection2D proj , SpatialComparable box ) { } } | SVGPath path = new SVGPath ( ) ; ArrayList < double [ ] > edges = getVisibleEdges ( proj , box ) ; final int dim = box . getDimensionality ( ) ; double [ ] min = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { min [ i ] = box . getMin ( i ) ; } double [ ] rv_min = proj . fastProjectDataToRenderSpace ( min ) ; recDrawEdges ( path , rv_min [ 0 ] , rv_min [ 1 ] , edges , BitsUtil . zero ( edges . size ( ) ) ) ; return path . makeElement ( svgp ) ; |
public class GBSDeleteFringe { /** * Balance a fringe following delete . */
void balance ( int t0_depth , DeleteStack stack ) { } } | int ntop = stack . topIndex ( ) ; InsertStack istack = stack . insertStack ( ) ; DeleteStack . Linearizer lxx = stack . linearizer ( ) ; DeleteStack . FringeNote xx = stack . fringeNote ( ) ; xx . depthDecrease = false ; xx . conditionalDecrease = false ; GBSNode f = stack . node ( ntop ) ; /* Father of the t0 fringe */
if ( ntop == 0 ) /* Final t0 fringe is to go away */
{ /* Make final sub - tree a list */
f . setRightChild ( linearize ( lxx , f . rightChild ( ) ) ) ; return ; /* Nothing left to do */
} GBSNode g = stack . node ( ntop - 1 ) ; /* Grandparent of the fringe */
boolean gLeft = true ; if ( g . rightChild ( ) == f ) { gLeft = false ; } if ( f . leftChild ( ) == stack . node ( ntop + 1 ) ) { /* Deleted from left */
leftFringe ( lxx , xx , istack , f , g , gLeft , t0_depth ) ; } else { /* Deleted from right */
rightFringe ( lxx , xx , istack , f , g , gLeft ) ; } lastFringe ( xx , g , gLeft , stack , ntop , istack ) ; |
public class OWLSubClassOfAxiomImpl_CustomFieldSerializer { /** * Serializes the content of the object into the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } .
* @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to write the
* object ' s content to
* @ param instance the object instance to serialize
* @ throws com . google . gwt . user . client . rpc . SerializationException
* if the serialization operation is not
* successful */
@ Override public void serializeInstance ( SerializationStreamWriter streamWriter , OWLSubClassOfAxiomImpl instance ) throws SerializationException { } } | serialize ( streamWriter , instance ) ; |
public class SIPBalancerForwarder { /** * ( non - Javadoc )
* @ see javax . sip . SipListener # processResponse ( javax . sip . ResponseEvent ) */
public void processResponse ( ResponseEvent responseEvent ) { } } | BalancerAppContent content = ( BalancerAppContent ) responseEvent . getSource ( ) ; boolean isIpv6 = content . isIpv6 ( ) ; SipProvider sipProvider = content . getProvider ( ) ; Response originalResponse = responseEvent . getResponse ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "got response :\n" + originalResponse ) ; } updateStats ( originalResponse ) ; final Response response = ( Response ) originalResponse ; Node senderNode = getSenderNode ( response ) ; if ( senderNode != null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Updating Timestamp of sendernode: " + senderNode ) ; } senderNode . updateTimerStamp ( ) ; } // Topmost via headers is me . As it is response to external request
ViaHeader viaHeader = ( ViaHeader ) response . getHeader ( ViaHeader . NAME ) ; String branch = viaHeader . getBranch ( ) ; int versionDelimiter = branch . lastIndexOf ( '_' ) ; String version = branch . substring ( versionDelimiter + 1 ) ; InvocationContext ctx = balancerRunner . getInvocationContext ( version ) ; if ( viaHeader != null && ! isHeaderExternal ( viaHeader . getHost ( ) , viaHeader . getPort ( ) , viaHeader . getTransport ( ) , isIpv6 ) ) { response . removeFirst ( ViaHeader . NAME ) ; } viaHeader = ( ViaHeader ) response . getHeader ( ViaHeader . NAME ) ; String transport = viaHeader . getTransport ( ) ; if ( viaHeader != null && ! isHeaderExternal ( viaHeader . getHost ( ) , viaHeader . getPort ( ) , viaHeader . getTransport ( ) , isIpv6 ) ) { response . removeFirst ( ViaHeader . NAME ) ; } boolean fromServer = false ; if ( balancerRunner . balancerContext . isTwoEntrypoints ( ) ) { if ( ! isIpv6 ) fromServer = sipProvider . equals ( balancerRunner . balancerContext . internalSipProvider ) ; else fromServer = sipProvider . equals ( balancerRunner . balancerContext . internalIpv6SipProvider ) ; if ( logger . isDebugEnabled ( ) ) { if ( ! isIpv6 ) logger . debug ( "fromServer : " + fromServer + ", sipProvider " + sipProvider + ", internalSipProvider " + balancerRunner . balancerContext . internalSipProvider ) ; else logger . debug ( "fromServer : " + fromServer + ", sipProvider " + sipProvider + ", internalIpv6SipProvider " + balancerRunner . balancerContext . internalIpv6SipProvider ) ; } } else { fromServer = senderNode == null ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "fromServer : " + fromServer + ", senderNode " + senderNode ) ; } } // removes rport and received from last Via header because of NEXMO patches it
// only for external responses
if ( balancerRunner . balancerContext . isUseWithNexmo && ! fromServer ) { viaHeader = ( ViaHeader ) response . getHeader ( ViaHeader . NAME ) ; if ( viaHeader != null ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "We are going to remove rport and received parametres from :" + viaHeader + " from external response" ) ; response . removeFirst ( ViaHeader . NAME ) ; viaHeader . removeParameter ( "rport" ) ; viaHeader . removeParameter ( "received" ) ; try { response . addFirst ( viaHeader ) ; } catch ( NullPointerException | SipException e ) { e . printStackTrace ( ) ; } if ( logger . isDebugEnabled ( ) ) logger . debug ( "After removing :" + response ) ; } } if ( fromServer ) { if ( senderNode != null && senderNode . getIp ( ) != null ) { if ( balancerRunner . balancerContext . maxRequestNumberWithoutResponse != null && balancerRunner . balancerContext . maxResponseTime != null ) { KeySip keySip = new KeySip ( senderNode , isIpv6 ) ; // adding null check for https : / / github . com / RestComm / load - balancer / issues / 83
Node currNode = ctx . sipNodeMap ( isIpv6 ) . get ( keySip ) ; if ( currNode != null ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "We are going to reset counters of health check" + currNode . getRequestNumberWithoutResponse ( ) + " : " + currNode . getLastTimeResponse ( ) ) ; currNode . setLastTimeResponse ( System . currentTimeMillis ( ) ) ; currNode . setRequestNumberWithoutResponse ( 0 ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Counter of request without responses is : " + currNode . getRequestNumberWithoutResponse ( ) + " : " + currNode . getLastTimeResponse ( ) ) ; } else { logger . warn ( "Node is null, we will not reset counters" ) ; } } mediaFailureDetection ( response , ctx , senderNode ) ; } /* if ( " true " . equals ( balancerRunner . balancerContext . properties . getProperty ( " removeNodesOn500Response " ) ) & & response . getStatusCode ( ) = = 500 ) {
/ / If the server is broken remove it from the list and try another one with the next retransmission
if ( ! ( sourceNode instanceof ExtraServerNode ) ) {
if ( balancerRunner . balancerContext . nodes . size ( ) > 1 ) {
balancerRunner . balancerContext . nodes . remove ( sourceNode ) ;
balancerRunner . balancerContext . balancerAlgorithm . nodeRemoved ( sourceNode ) ; */
String publicIp = null ; if ( ! isIpv6 ) publicIp = balancerRunner . balancerContext . publicIP ; else publicIp = balancerRunner . balancerContext . publicIPv6 ; if ( publicIp != null && publicIp . trim ( ) . length ( ) > 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Will add Record-Route header to response with public IP Address: " + publicIp ) ; } patchSipMessageForNAT ( response , isIpv6 ) ; } // https : / / github . com / RestComm / load - balancer / issues / 45 Adding sender node for the algorithm to be available
( ( ResponseExt ) response ) . setApplicationData ( senderNode ) ; ctx . balancerAlgorithm . processInternalResponse ( response , isIpv6 ) ; try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "from server sending response externally " + response ) ; } if ( ! isIpv6 ) balancerRunner . balancerContext . externalSipProvider . sendResponse ( response ) ; else balancerRunner . balancerContext . externalIpv6SipProvider . sendResponse ( response ) ; } catch ( Exception ex ) { logger . error ( "Unexpected exception while forwarding the response \n" + response , ex ) ; } } else { try { SIPMessage message = ( SIPMessage ) response ; String initialRemoteAddr = message . getPeerPacketSourceAddress ( ) . getHostAddress ( ) ; String initialRemotePort = String . valueOf ( message . getPeerPacketSourcePort ( ) ) ; Header remoteAddrHeader = null ; Header remotePortHeader = null ; try { HeaderFactory hf = SipFactory . getInstance ( ) . createHeaderFactory ( ) ; remoteAddrHeader = hf . createHeader ( "X-Sip-Balancer-InitialRemoteAddr" , initialRemoteAddr ) ; remotePortHeader = hf . createHeader ( "X-Sip-Balancer-InitialRemotePort" , initialRemotePort ) ; } catch ( PeerUnavailableException e ) { logger . error ( "Unexpected exception while creating custom headers for REGISTER message " , e ) ; } catch ( ParseException e ) { logger . error ( "Unexpected exception while creating custom headers for REGISTER message " , e ) ; } if ( remoteAddrHeader != null ) response . addHeader ( remoteAddrHeader ) ; if ( remotePortHeader != null ) response . addHeader ( remotePortHeader ) ; if ( balancerRunner . balancerContext . isTwoEntrypoints ( ) ) { ctx . balancerAlgorithm . processExternalResponse ( response , isIpv6 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "two entry points: from external sending response " + response ) ; } if ( ! isIpv6 ) balancerRunner . balancerContext . internalSipProvider . sendResponse ( response ) ; else balancerRunner . balancerContext . internalIpv6SipProvider . sendResponse ( response ) ; } else { if ( ! comesFromInternalNode ( response , ctx , initialRemoteAddr , message . getPeerPacketSourcePort ( ) , transport , isIpv6 ) ) ctx . balancerAlgorithm . processExternalResponse ( response , isIpv6 ) ; else ctx . balancerAlgorithm . processInternalResponse ( response , isIpv6 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "one entry point: from external sending response " + response ) ; } if ( ! isIpv6 ) balancerRunner . balancerContext . externalSipProvider . sendResponse ( response ) ; else balancerRunner . balancerContext . externalIpv6SipProvider . sendResponse ( response ) ; } } catch ( Exception ex ) { logger . error ( "Unexpected exception while forwarding the response \n" + response , ex ) ; } } |
public class ListLicenseConfigurationsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListLicenseConfigurationsRequest listLicenseConfigurationsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listLicenseConfigurationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listLicenseConfigurationsRequest . getLicenseConfigurationArns ( ) , LICENSECONFIGURATIONARNS_BINDING ) ; protocolMarshaller . marshall ( listLicenseConfigurationsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listLicenseConfigurationsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listLicenseConfigurationsRequest . getFilters ( ) , FILTERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CmsVfsDriver { /** * Creates a new counter . < p >
* @ param dbc the database context
* @ param name the name of the counter to create
* @ param value the inital value of the counter
* @ throws CmsDbSqlException if something goes wrong */
protected void internalCreateCounter ( CmsDbContext dbc , String name , int value ) throws CmsDbSqlException { } } | PreparedStatement stmt = null ; Connection conn = null ; try { conn = m_sqlManager . getConnection ( dbc ) ; stmt = m_sqlManager . getPreparedStatement ( conn , CmsProject . ONLINE_PROJECT_ID , "C_CREATE_COUNTER" ) ; stmt . setString ( 1 , name ) ; stmt . setInt ( 2 , value ) ; stmt . executeUpdate ( ) ; } catch ( SQLException e ) { throw wrapException ( stmt , e ) ; } finally { m_sqlManager . closeAll ( dbc , conn , stmt , null ) ; } |
public class WmsLayerInfo111 { protected void parse ( Node node ) { } } | queryable = isQueryable ( node ) ; styleInfo . clear ( ) ; NodeList childNodes = node . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node child = childNodes . item ( i ) ; String nodeName = child . getNodeName ( ) ; if ( "Name" . equalsIgnoreCase ( nodeName ) ) { name = getValueRecursive ( child ) ; } else if ( "Title" . equalsIgnoreCase ( nodeName ) ) { title = getValueRecursive ( child ) ; } else if ( "Abstract" . equalsIgnoreCase ( nodeName ) ) { abstractt = getValueRecursive ( child ) ; } else if ( "KeywordList" . equalsIgnoreCase ( nodeName ) ) { addKeyWords ( child ) ; } else if ( "SRS" . equalsIgnoreCase ( nodeName ) ) { crs . add ( getValueRecursive ( child ) ) ; } else if ( "BoundingBox" . equalsIgnoreCase ( nodeName ) ) { addBoundingBox ( child ) ; } else if ( "LatLonBoundingBox" . equalsIgnoreCase ( nodeName ) ) { addLatLonBoundingBox ( child ) ; } else if ( "MetadataURL" . equalsIgnoreCase ( nodeName ) ) { metadataUrls . add ( new WmsLayerMetadataUrlInfo111 ( child ) ) ; } else if ( "Style" . equalsIgnoreCase ( nodeName ) ) { styleInfo . add ( new WmsLayerStyleInfo111 ( child ) ) ; } else if ( "ScaleHint" . equalsIgnoreCase ( nodeName ) ) { if ( hasAttribute ( child , "min" ) ) { minScaleDenominator = getAttributeAsDouble ( child , "min" ) ; } if ( hasAttribute ( child , "max" ) ) { maxScaleDenominator = getAttributeAsDouble ( child , "max" ) ; } } } parsed = true ; |
public class LostExceptionStackTrace { /** * looks to update the catchinfo block with the register used for the exception variable . If their is a local variable table , but the local variable can ' t
* be found return false , signifying an empty catch block .
* @ param ci
* the catchinfo record for the catch starting at this pc
* @ param seen
* the opcode of the currently visited instruction
* @ param pc
* the current pc
* @ return whether the catch block is empty */
private boolean updateExceptionRegister ( CatchInfo ci , int seen , int pc ) { } } | if ( OpcodeUtils . isAStore ( seen ) ) { int reg = RegisterUtils . getAStoreReg ( this , seen ) ; ci . setReg ( reg ) ; exReg . put ( Integer . valueOf ( reg ) , Boolean . TRUE ) ; LocalVariableTable lvt = getMethod ( ) . getLocalVariableTable ( ) ; if ( lvt != null ) { LocalVariable lv = lvt . getLocalVariable ( reg , pc + 2 ) ; if ( lv != null ) { int finish = lv . getStartPC ( ) + lv . getLength ( ) ; if ( finish < ci . getFinish ( ) ) { ci . setFinish ( finish ) ; } } else { return false ; } } } return true ; |
public class CacheFilter { /** * Set HTTP cache headers .
* { @ inheritDoc } */
@ Override public void doFilter ( ServletRequest servletRequest , ServletResponse servletResponse , FilterChain filterChain ) throws IOException , ServletException { } } | HttpServletResponse httpServletResponse = ( HttpServletResponse ) servletResponse ; StringBuilder cacheControl = new StringBuilder ( cacheability . getValue ( ) ) . append ( ", max-age=" ) . append ( expiration ) ; if ( mustRevalidate ) { cacheControl . append ( ", must-revalidate" ) ; } // Set cache directives
httpServletResponse . setHeader ( HTTPCacheHeader . CACHE_CONTROL . getName ( ) , cacheControl . toString ( ) ) ; httpServletResponse . setDateHeader ( HTTPCacheHeader . EXPIRES . getName ( ) , System . currentTimeMillis ( ) + expiration * 1000L ) ; // Set Vary field
if ( vary != null && ! vary . isEmpty ( ) ) { httpServletResponse . setHeader ( HTTPCacheHeader . VARY . getName ( ) , vary ) ; } /* * By default , some servers ( e . g . Tomcat ) will set headers on any SSL content to deny caching . Omitting the
* Pragma header takes care of user - agents implementing HTTP / 1.0. */
filterChain . doFilter ( servletRequest , new HttpServletResponseWrapper ( httpServletResponse ) { @ Override public void addHeader ( String name , String value ) { if ( ! HTTPCacheHeader . PRAGMA . getName ( ) . equalsIgnoreCase ( name ) ) { super . addHeader ( name , value ) ; } } @ Override public void setHeader ( String name , String value ) { if ( ! HTTPCacheHeader . PRAGMA . getName ( ) . equalsIgnoreCase ( name ) ) { super . setHeader ( name , value ) ; } } } ) ; |
public class ClassCacheMgr { /** * For each class that should be managed , this method must be called to parse
* its annotations and derive its meta - data .
* @ param < T >
* @ param clazz
* @ return CFMapping describing the initialized class . */
public < T > CFMappingDef < T > initializeCacheForClass ( Class < T > clazz ) { } } | CFMappingDef < T > cfMapDef = initializeColumnFamilyMapDef ( clazz ) ; try { initializePropertiesMapDef ( cfMapDef ) ; } catch ( IntrospectionException e ) { throw new HectorObjectMapperException ( e ) ; } catch ( InstantiationException e ) { throw new HectorObjectMapperException ( e ) ; } catch ( IllegalAccessException e ) { throw new HectorObjectMapperException ( e ) ; } // by the time we get here , all super classes and their annotations have
// been processed and validated , and all annotations for this class have
// been processed . what ' s left to do is validate this class , set super
// classes , and and set any defaults
checkMappingAndSetDefaults ( cfMapDef ) ; // if this class is not a derived class , then map the ColumnFamily name
if ( ! cfMapDef . isDerivedEntity ( ) ) { cfMapByColFamName . put ( cfMapDef . getEffectiveColFamName ( ) , cfMapDef ) ; } // always map the parsed class to its ColumnFamily map definition
cfMapByClazz . put ( cfMapDef . getRealClass ( ) , cfMapDef ) ; return cfMapDef ; |
public class SessionChangesLog { /** * An example of use : transient changes of item added and removed in same session . These changes
* must not fire events in observation .
* @ param identifier */
public void eraseEventFire ( String identifier ) { } } | ItemState item = getItemState ( identifier ) ; if ( item != null ) { item . eraseEventFire ( ) ; Map < String , ItemState > children = lastChildPropertyStates . get ( identifier ) ; if ( children != null ) { // Call the method ItemState . eraseEventFire ( ) on each properties
for ( ItemState child : children . values ( ) ) { child . eraseEventFire ( ) ; } } children = lastChildNodeStates . get ( identifier ) ; if ( children != null ) { // Recursively call the method eraseEventFire ( String identifier ) for each sub node
for ( ItemState child : children . values ( ) ) { eraseEventFire ( child . getData ( ) . getIdentifier ( ) ) ; } } } |
public class ModelsImpl { /** * Create an entity role for an entity in the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param entityId The entity model ID .
* @ param createCustomPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
* @ 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 < UUID > createCustomPrebuiltEntityRoleAsync ( UUID appId , String versionId , UUID entityId , CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter , final ServiceCallback < UUID > serviceCallback ) { } } | return ServiceFuture . fromResponse ( createCustomPrebuiltEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , createCustomPrebuiltEntityRoleOptionalParameter ) , serviceCallback ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.