signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class EntityManagerSession { /** * Removes the from cache . * @ param < T > * the generic type * @ param entityClass * the entity class * @ param id * the id * @ param spillOverToL2 * the spill over to l2 */ protected < T > void remove ( Class < T > entityClass , Object id , boolean spillOverToL2 ) { } }
String key = cacheKey ( entityClass , id ) ; LOG . debug ( "Removing from L1 >> " + key ) ; Object o = sessionCache . remove ( key ) ; if ( spillOverToL2 ) { LOG . debug ( "Removing from L2 >> " + key ) ; Cache c = ( Cache ) getL2Cache ( ) ; if ( c != null ) { c . evict ( entityClass , key ) ; } }
public class ChannelManager { /** * Retrieve all the stored channels */ public synchronized Collection < T > getAllChannels ( ) { } }
Collection < T > allChannels = new ArrayList < T > ( ) ; allChannels . addAll ( this . channels ) ; allChannels . addAll ( this . channelsWithId . values ( ) ) ; return allChannels ;
public class SphericalUtil { /** * Returns the IGeoPoint which lies the given fraction of the way between the * origin IGeoPoint and the destination IGeoPoint . * @ param from The IGeoPoint from which to start . * @ param to The IGeoPoint toward which to travel . * @ param fraction A fraction of the distance to travel . * @ return The interpolated IGeoPoint . */ public static IGeoPoint interpolate ( IGeoPoint from , IGeoPoint to , double fraction ) { } }
// http : / / en . wikipedia . org / wiki / Slerp double fromLat = toRadians ( from . getLatitude ( ) ) ; double fromLng = toRadians ( from . getLongitude ( ) ) ; double toLat = toRadians ( to . getLatitude ( ) ) ; double toLng = toRadians ( to . getLongitude ( ) ) ; double cosFromLat = cos ( fromLat ) ; double cosToLat = cos ( toLat ) ; // Computes Spherical interpolation coefficients . double angle = computeAngleBetween ( from , to ) ; double sinAngle = sin ( angle ) ; if ( sinAngle < 1E-6 ) { return from ; } double a = sin ( ( 1 - fraction ) * angle ) / sinAngle ; double b = sin ( fraction * angle ) / sinAngle ; // Converts from polar to vector and interpolate . double x = a * cosFromLat * cos ( fromLng ) + b * cosToLat * cos ( toLng ) ; double y = a * cosFromLat * sin ( fromLng ) + b * cosToLat * sin ( toLng ) ; double z = a * sin ( fromLat ) + b * sin ( toLat ) ; // Converts interpolated vector back to polar . double lat = atan2 ( z , sqrt ( x * x + y * y ) ) ; double lng = atan2 ( y , x ) ; return new GeoPoint ( toDegrees ( lat ) , toDegrees ( lng ) ) ;
public class ConsumerUtil { /** * Verifies that tokenIssuer is one of the values specified in the * comma - separated issuers string . */ boolean validateIssuer ( String consumerConfigId , String issuers , String tokenIssuer ) throws InvalidClaimException { } }
boolean isIssuer = false ; if ( issuers == null || issuers . isEmpty ( ) ) { String msg = Tr . formatMessage ( tc , "JWT_TRUSTED_ISSUERS_NULL" , new Object [ ] { tokenIssuer , consumerConfigId } ) ; throw new InvalidClaimException ( msg ) ; } StringTokenizer st = new StringTokenizer ( issuers , "," ) ; while ( st . hasMoreTokens ( ) ) { String iss = st . nextToken ( ) . trim ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trusted issuer: " + iss ) ; } if ( Constants . ALL_ISSUERS . equals ( iss ) || ( tokenIssuer != null && tokenIssuer . equals ( iss ) ) ) { isIssuer = true ; break ; } } if ( ! isIssuer ) { String msg = Tr . formatMessage ( tc , "JWT_ISSUER_NOT_TRUSTED" , new Object [ ] { tokenIssuer , consumerConfigId , issuers } ) ; throw new InvalidClaimException ( msg ) ; } return isIssuer ;
public class BugInstance { /** * Add a class annotation for the classNode . * @ param classNode * the ASM visitor * @ return this object */ @ Nonnull public BugInstance addClass ( ClassNode classNode ) { } }
String dottedClassName = ClassName . toDottedClassName ( classNode . name ) ; ClassAnnotation classAnnotation = new ClassAnnotation ( dottedClassName ) ; add ( classAnnotation ) ; return this ;
public class UndoRedoService { /** * Undo the last command . */ public void undo ( ) { } }
// If there is at least one command left to undo if ( this . commandStack . size ( ) > 0 ) { // Here put the last command on the undone stack this . undoneStack . add ( this . commandStack . get ( this . commandStack . size ( ) - 1 ) ) ; // here remove the last command of the command stack this . commandStack . remove ( this . commandStack . get ( this . commandStack . size ( ) - 1 ) ) ; // Call Undo method this . undoneStack . get ( this . undoneStack . size ( ) - 1 ) . run ( WBuilder . wave ( ) . addDatas ( WBuilder . waveData ( UndoRedoWaves . UNDO_REDO , true ) ) ) ; } else { // begin of stack , do nothing LOGGER . info ( "No more command to undo, begin of stack" ) ; }
public class GeometryUtilities { /** * Calculates the angle between two { @ link LineSegment } s . * @ param l1 the first segment . * @ param l2 the second segment . * @ return the angle between the two segments , starting from the first segment * moving clockwise . */ public static double angleBetween ( LineSegment l1 , LineSegment l2 ) { } }
double azimuth1 = azimuth ( l1 . p0 , l1 . p1 ) ; double azimuth2 = azimuth ( l2 . p0 , l2 . p1 ) ; if ( azimuth1 < azimuth2 ) { return azimuth2 - azimuth1 ; } else { return 360 - azimuth1 + azimuth2 ; }
public class BootstrapContextImpl { /** * Returns the JCAContextProvider for the specified work context class . * @ param workContextClass a WorkContext implementation class or ExecutionContext . * @ return the JCAContextProvider for the specified work context class . */ JCAContextProvider getJCAContextProvider ( Class < ? > workContextClass ) { } }
JCAContextProvider provider = null ; for ( Class < ? > cl = workContextClass ; provider == null && cl != null ; cl = cl . getSuperclass ( ) ) provider = contextProviders . getService ( cl . getName ( ) ) ; return provider ;
public class Util { /** * URL encode a path segment . This is just a thin wrapper around UriUtils . encodePathSegment . It * is intended for the case where you are building URLs in JS . c : url + escapeBody doesn ' t * correctly escape the contents ( especially " < / script > " ) , and fn : escapeXml incorrectly encodes * the URL ( it escapes chars like ' < ' as & lt ; instead of % 3C ) . It should help avoid XSS attacks * when building RESTful URLS in js . Example : * < p > Given : $ { userId } - > " < script > alert ( ' test ' ) < / script > * < p > . . . < script > $ . ajax ( { url : < c : url value = ' / users / $ { up : encodePathSegment ( userId ) } ' / > } ) ; * < / script > * < p > Will encode the URL as : * < p > / users / % 3Cscript % 3Ealert ( ' test % ' ) % 3C % 2Fscript % 3E * < p > IMPORTANT : Note that this encodes the ' / ' in < / script > to % 2F . Unfortunately , tomcat still * does not interpret % 2F correctly unless you relax some security settings ( @ see * tomcat . apache . org / tomcat - 7.0 - doc / config / systemprops . html # Security , the ALLOW _ ENCODED _ SLASH * property ) . So , while this method does a better job at avoiding XSS issues than c : url , it ' s * still not ideal . Unless the input is whitelisted to avoid invalid input chars , it ' s still * possible to end up with REST URLs that won ' t work correctly ( like the one above ) , but at * least this will protect you from XSS attacks on the front end . * @ param val the path segment to encode * @ return the encoded path segment */ public static String encodePathSegment ( String val ) { } }
try { return UriUtils . encodePathSegment ( val , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // should be unreachable . . . throw new RuntimeException ( e ) ; }
public class ListWorkerBlocksResult { /** * The list of WorkerBlocks , containing the collection of Worker IDs and reasons for blocking . * @ param workerBlocks * The list of WorkerBlocks , containing the collection of Worker IDs and reasons for blocking . */ public void setWorkerBlocks ( java . util . Collection < WorkerBlock > workerBlocks ) { } }
if ( workerBlocks == null ) { this . workerBlocks = null ; return ; } this . workerBlocks = new java . util . ArrayList < WorkerBlock > ( workerBlocks ) ;
public class CartUrl { /** * Get Resource Url for GetUserCartSummary * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss . * @ param userId Unique identifier of the user whose tenant scopes you want to retrieve . * @ return String Resource Url */ public static MozuUrl getUserCartSummaryUrl ( String responseFields , String userId ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/user/{userId}/summary?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "userId" , userId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class BaseMessagingEngineImpl { /** * @ see com . ibm . ws . sib . admin . JsMessagingEngine # loadLocalizations ( ) */ public final void loadLocalizations ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "loadLocalizations" , this ) ; _localizer . loadLocalizations ( ) ; try { setJsDestinationUUIDCache ( _localizer . updatedDestDefList ) ; } catch ( Exception e ) { SibTr . entry ( tc , "Exception while updating UUID Destination Cache in " , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "loadLocalizations" ) ;
public class MessageProcessor { /** * Gets a reference to the actual bus which this messaging engine belongs * to . * @ return */ public JsBus getBus ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getBus" ) ; JsBus jsBus = ( JsBus ) _engine . getBus ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getBus" , jsBus ) ; return jsBus ;
public class PropertyUtils { /** * Return the value of the specified simple property of the specified bean , * with string conversions . * @ param bean * Bean whose property is to be extracted * @ param name * Name of the property to be extracted * @ return the value of the specified simple property of the specified bean , * with string conversions . * @ exception IllegalAccessException * if the caller does not have access to the property * accessor method * @ exception IllegalArgumentException * if < code > bean < / code > or < code > name < / code > is null * @ exception IllegalArgumentException * if the property name is nested or indexed * @ exception InvocationTargetException * if the property accessor method throws an exception * @ exception NoSuchMethodException * if an accessor method for this propety cannot be found */ public static String getProperty ( Object bean , String name ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } }
String value = null ; // Retrieve the property getter method for the specified property PropertyDescriptor descriptor = getPropertyDescriptor ( bean , name ) ; if ( descriptor == null ) { throw new NoSuchMethodException ( "Unknown property '" + name + "'" ) ; } Method readMethod = descriptor . getReadMethod ( ) ; if ( readMethod == null ) { throw new NoSuchMethodException ( "Property '" + name + "' has no getter method" ) ; } // Call the property getter and return the value Object result = ( Object ) invokeMethod ( readMethod , bean , new Object [ 0 ] ) ; if ( result != null ) { value = result . toString ( ) ; } return value ;
public class AWSMediaLiveClient { /** * Produces a summary of an Input Security Group * @ param describeInputSecurityGroupRequest * Placeholder documentation for DescribeInputSecurityGroupRequest * @ return Result of the DescribeInputSecurityGroup operation returned by the service . * @ throws BadRequestException * The request to describe an Input Security Group was Invalid * @ throws InternalServerErrorException * Internal Server Error * @ throws ForbiddenException * The requester does not have permission to describe this Input Security Group * @ throws BadGatewayException * Bad Gateway Error * @ throws NotFoundException * Input Security Group not found * @ throws GatewayTimeoutException * Gateway Timeout Error * @ throws TooManyRequestsException * Limit Exceeded Error * @ sample AWSMediaLive . DescribeInputSecurityGroup * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / medialive - 2017-10-14 / DescribeInputSecurityGroup " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeInputSecurityGroupResult describeInputSecurityGroup ( DescribeInputSecurityGroupRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeInputSecurityGroup ( request ) ;
public class CmsContainerpageController { /** * Tells the controller that group - container editing has started . < p > * @ param groupContainer the group container * @ param isElementGroup < code > true < / code > if the group container is an element group and not an inheritance group */ public void startEditingGroupcontainer ( final CmsGroupContainerElementPanel groupContainer , final boolean isElementGroup ) { } }
removeEditButtonsPositionTimer ( ) ; I_CmsSimpleCallback < Boolean > callback = new I_CmsSimpleCallback < Boolean > ( ) { public void execute ( Boolean arg ) { if ( arg . booleanValue ( ) ) { if ( isElementGroup ) { m_groupEditor = CmsGroupContainerEditor . openGroupcontainerEditor ( groupContainer , CmsContainerpageController . this , m_handler ) ; } else { m_groupEditor = CmsInheritanceContainerEditor . openInheritanceContainerEditor ( groupContainer , CmsContainerpageController . this , m_handler ) ; } } else { CmsNotification . get ( ) . send ( Type . WARNING , Messages . get ( ) . key ( Messages . GUI_NOTIFICATION_UNABLE_TO_LOCK_0 ) ) ; } } } ; if ( ( m_groupEditor == null ) && ( groupContainer . isNew ( ) ) ) { callback . execute ( Boolean . TRUE ) ; } else { lockContainerpage ( callback ) ; }
public class ErrorReporter { /** * Writes the error to the specified < code > PrintStream < / code > . */ public void write ( PrintStream stream ) { } }
this . output = stream ; dispatch ( base , false ) ; stream . flush ( ) ;
public class NetUtility { /** * Process an HTML get or post . * @ param req The servlet request . * @ param res The servlet response object . * @ exception ServletException From inherited class . * @ exception IOException From inherited class . */ public static void getNetTable ( String strRecordClass , String strTableName , String strLanguage , ThinPhysicalDatabaseOwner databaseOwner , ThinPhysicalTableOwner tableOwner , RecordOwner recordOwner , OutputStream ostream ) throws IOException { } }
String oldLanguage = null ; if ( strLanguage != null ) if ( strLanguage . length ( ) > 0 ) { // Possible concurrency problems oldLanguage = recordOwner . getTask ( ) . getApplication ( ) . getLanguage ( true ) ; if ( ! strLanguage . equals ( oldLanguage ) ) recordOwner . getTask ( ) . getApplication ( ) . setLanguage ( strLanguage ) ; } String databaseName = null ; if ( strTableName != null ) { if ( strTableName . lastIndexOf ( '/' ) != - 1 ) { databaseName = strTableName . substring ( 0 , strTableName . lastIndexOf ( '/' ) ) ; if ( databaseName . lastIndexOf ( '/' ) != - 1 ) databaseName = databaseName . substring ( databaseName . lastIndexOf ( '/' ) + 1 ) ; strTableName = strTableName . substring ( strTableName . lastIndexOf ( '/' ) + 1 ) ; if ( strTableName . indexOf ( '.' ) != - 1 ) strTableName = strTableName . substring ( 0 , strTableName . indexOf ( '.' ) ) ; } } Utility . getLogger ( ) . info ( "Net DB Requested: " + strRecordClass ) ; if ( strRecordClass == null ) return ; if ( strRecordClass . startsWith ( "." ) ) strRecordClass = DBConstants . ROOT_PACKAGE + strRecordClass . substring ( 1 ) ; // Never String strThinRecordClass = Util . convertClassName ( strRecordClass , DBConstants . THIN_SUBPACKAGE ) ; FieldList fieldList = NetUtility . makeThinRecordFromClassname ( strThinRecordClass ) ; if ( fieldList == null ) return ; Environment env = ( ( BaseApplication ) recordOwner . getTask ( ) . getApplication ( ) ) . getEnvironment ( ) ; PhysicalDatabaseParent dbParent = ( PhysicalDatabaseParent ) env . getPDatabaseParent ( mapDBParentProperties , true ) ; PDatabase pDatabase = dbParent . getPDatabase ( databaseName , ThinPhysicalDatabase . MEMORY_TYPE , true ) ; // Get / create database pDatabase . addPDatabaseOwner ( databaseOwner ) ; if ( strLanguage != null ) if ( strLanguage . length ( ) > 0 ) if ( fieldList . getTableNames ( false ) != null ) fieldList . setTableNames ( fieldList . getTableNames ( false ) + '_' + strLanguage ) ; PTable pTable = pDatabase . getPTable ( fieldList , false ) ; if ( pTable == null ) { pTable = pDatabase . getPTable ( fieldList , true , true ) ; // Create it ( with grid access ) pTable . addPTableOwner ( tableOwner ) ; if ( strRecordClass . equalsIgnoreCase ( strThinRecordClass ) ) { // Asking for the thin record , get the thick record class name int startThin = strThinRecordClass . indexOf ( Constants . THIN_SUBPACKAGE , 0 ) ; if ( startThin != - 1 ) // Always strRecordClass = strThinRecordClass . substring ( 0 , startThin ) + strThinRecordClass . substring ( startThin + Constants . THIN_SUBPACKAGE . length ( ) ) ; } Record record = Record . makeRecordFromClassName ( strRecordClass , recordOwner , false , true ) ; if ( record == null ) return ; if ( strTableName != null ) if ( strTableName . length ( ) > 0 ) if ( ( ! strTableName . equalsIgnoreCase ( record . getTableNames ( false ) ) ) ) if ( ( record . getDatabaseType ( ) & DBConstants . MAPPED ) != 0 ) record . setTableNames ( strTableName ) ; if ( databaseName != null ) if ( ! databaseName . equalsIgnoreCase ( record . getDatabaseName ( ) ) ) { // Set alternate database name // Yikes . . . This is a little off logic because I use the actual long database name to create a database ( It should work though ) BaseDatabase database = ( BaseDatabase ) recordOwner . getDatabaseOwner ( ) . getDatabase ( databaseName , record . getDatabaseType ( ) , null ) ; BaseTable table = database . makeTable ( record ) ; record . setTable ( table ) ; } record . init ( recordOwner ) ; record . populateThinTable ( fieldList , false ) ; record . free ( ) ; fieldList . getTable ( ) . free ( ) ; } ObjectOutputStream outstream = new ObjectOutputStream ( ostream ) ; outstream . writeObject ( pTable ) ; // Write the tree to the stream . pTable . removePTableOwner ( tableOwner , true ) ; // Hopefully this is cached , so I don ' t have to create it again pDatabase . removePDatabaseOwner ( databaseOwner , true ) ; outstream . flush ( ) ; if ( oldLanguage != null ) if ( oldLanguage . length ( ) > 0 ) recordOwner . getTask ( ) . getApplication ( ) . setLanguage ( oldLanguage ) ;
public class Checks { /** * Checks if the given string is a valid metadata identifier . */ public static String checkMetadataIdentifier ( String s ) { } }
// Note that we avoid using regular expressions here , since we ' ve not used it anywhere else // thus far in Flogger ( avoid it make it more likely that Flogger can be transpiled for things // like GWT ) . if ( s . isEmpty ( ) ) { throw new IllegalArgumentException ( "identifier must not be empty" ) ; } if ( ! isLetter ( s . charAt ( 0 ) ) ) { throw new IllegalArgumentException ( "identifier must start with an ASCII letter: " + s ) ; } for ( int n = 1 ; n < s . length ( ) ; n ++ ) { char c = s . charAt ( n ) ; if ( ! isLetter ( c ) && ( c < '0' || c > '9' ) && c != '_' ) { throw new IllegalArgumentException ( "identifier must contain only ASCII letters, digits or underscore: " + s ) ; } } return s ;
public class InstanceAdminExample { /** * Demonstrates how to add a cluster to an instance . */ public void addCluster ( ) { } }
System . out . printf ( "%nAdding cluster: %s to instance: %s%n" , CLUSTER , instanceId ) ; // [ START bigtable _ create _ cluster ] try { adminClient . createCluster ( CreateClusterRequest . of ( instanceId , CLUSTER ) . setZone ( "us-central1-c" ) . setServeNodes ( 3 ) . setStorageType ( StorageType . SSD ) ) ; System . out . printf ( "Cluster: %s created successfully%n" , CLUSTER ) ; } catch ( AlreadyExistsException e ) { System . err . println ( "Failed to add cluster, already exists: " + e . getMessage ( ) ) ; } // [ END bigtable _ create _ cluster ]
public class CommercePriceListAccountRelUtil { /** * Returns the first commerce price list account rel in the ordered set where commercePriceListId = & # 63 ; . * @ param commercePriceListId the commerce price list ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce price list account rel , or < code > null < / code > if a matching commerce price list account rel could not be found */ public static CommercePriceListAccountRel fetchByCommercePriceListId_First ( long commercePriceListId , OrderByComparator < CommercePriceListAccountRel > orderByComparator ) { } }
return getPersistence ( ) . fetchByCommercePriceListId_First ( commercePriceListId , orderByComparator ) ;
public class HylaFAXClientConnectionFactoryImpl { /** * Releases the resource from the connection . * @ param resource * The resource */ @ Override protected void releaseResourceImpl ( HylaFAXClient resource ) { } }
try { // release client resource . quit ( ) ; } catch ( Exception exception ) { // log error this . LOGGER . logDebug ( new Object [ ] { "Error while closing client." } , exception ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcProfileTypeEnum ( ) { } }
if ( ifcProfileTypeEnumEEnum == null ) { ifcProfileTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1037 ) ; } return ifcProfileTypeEnumEEnum ;
public class TextImpl { /** * Returns the first text or CDATA node in the current sequence of text and * CDATA nodes . */ private TextImpl firstTextNodeInCurrentRun ( ) { } }
TextImpl firstTextInCurrentRun = this ; for ( Node p = getPreviousSibling ( ) ; p != null ; p = p . getPreviousSibling ( ) ) { short nodeType = p . getNodeType ( ) ; if ( nodeType == Node . TEXT_NODE || nodeType == Node . CDATA_SECTION_NODE ) { firstTextInCurrentRun = ( TextImpl ) p ; } else { break ; } } return firstTextInCurrentRun ;
public class ChemObjectDiff { /** * Compare two { @ link IChemObject } classes and return the difference as an { @ link IDifference } . * @ param first the first of the two classes to compare * @ param second the second of the two classes to compare * @ return an { @ link IDifference } representation of the difference between the first and second { @ link IChemObject } . */ public static IDifference difference ( IChemObject first , IChemObject second ) { } }
if ( ! ( first instanceof IChemObject && second instanceof IChemObject ) ) { return null ; } IChemObject firstElem = ( IChemObject ) first ; IChemObject secondElem = ( IChemObject ) second ; ChemObjectDifference coDiff = new ChemObjectDifference ( "ChemObjectDiff" ) ; // Compare flags boolean [ ] firstFlags = firstElem . getFlags ( ) ; boolean [ ] secondFlags = secondElem . getFlags ( ) ; coDiff . addChild ( BooleanArrayDifference . construct ( "flag" , firstFlags , secondFlags ) ) ; if ( coDiff . childCount ( ) > 0 ) { return coDiff ; } else { return null ; }
public class Tuple6 { /** * Skip 2 degrees from this tuple . */ public final Tuple4 < T3 , T4 , T5 , T6 > skip2 ( ) { } }
return new Tuple4 < > ( v3 , v4 , v5 , v6 ) ;
public class DestinationManager { /** * Deletes the system destination from the given destination address */ public void deleteSystemDestination ( JsDestinationAddress destAddr ) throws SIResourceException , SINotPossibleInCurrentConfigurationException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteSystemDestination" , new Object [ ] { destAddr } ) ; BaseDestinationHandler destinationHandler = null ; DestinationTypeFilter filter = new DestinationTypeFilter ( ) ; filter . VISIBLE = Boolean . TRUE ; filter . ALIAS = Boolean . FALSE ; filter . FOREIGN_DESTINATION = Boolean . FALSE ; DestinationHandler dh = destinationIndex . findByName ( destAddr . getDestinationName ( ) , messageProcessor . getMessagingEngineBus ( ) , filter ) ; try { checkDestinationHandlerExists ( dh != null , destAddr . getDestinationName ( ) , messageProcessor . getMessagingEngineName ( ) ) ; } catch ( SITemporaryDestinationNotFoundException e ) { // / / FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DestinationManager.deleteSystemDestination" , "1:5408:1.508.1.7" , this ) ; // This shouldn ' t occur as the Connection will create a valid system destination . // Or validate that the destination address passed in is a system destination if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteSystemDestination" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "com.ibm.ws.sib.processor.impl.DestinationManager" , "1:5421:1.508.1.7" , e , destAddr . getDestinationName ( ) } , null ) , e ) ; } destinationHandler = ( BaseDestinationHandler ) dh ; deleteSystemDestination ( destinationHandler ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteSystemDestination" ) ;
public class HtmlExample { /** * < p > addChild . < / p > * @ return a { @ link com . greenpepper . Example } object . */ public Example addChild ( ) { } }
if ( hasChild ( ) ) { return child . addSibling ( ) ; } else { if ( childTags . isEmpty ( ) ) throw new IllegalStateException ( "No child tag" ) ; List < String > moreTags = new ArrayList < String > ( childTags ) ; String childTag = firstPattern ( CollectionUtil . shift ( moreTags ) ) ; child = createSpecification ( childTag , moreTags ) ; return child ; }
public class SameDiff { /** * Get the input variable ( s ) for the specified differential function * @ param function the function reference to get the input variable ( s ) for * @ return the input variables for the given function */ public SDVariable [ ] getInputVariablesForFunction ( DifferentialFunction function ) { } }
val inputs = getInputsForFunction ( function ) ; if ( inputs == null ) { throw new ND4JIllegalStateException ( "No inputs found for function " + function ) ; } val vars = new SDVariable [ inputs . length ] ; for ( int i = 0 ; i < inputs . length ; i ++ ) { vars [ i ] = getVariable ( inputs [ i ] ) ; if ( vars [ i ] == null ) { throw new ND4JIllegalStateException ( "Found null variable at index " + i ) ; } } return vars ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcActuatorTypeEnum createIfcActuatorTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcActuatorTypeEnum result = IfcActuatorTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class AsciiTableWidth { /** * Creates a new width object . * @ param minWidth minimum column width as number of characters * @ param maxWidth maximum column width as number of characters * @ return self to allow for chaining */ public AsciiTableWidth add ( final int minWidth , final int maxWidth ) { } }
this . minWidths = ArrayUtils . add ( this . minWidths , minWidth ) ; this . maxWidths = ArrayUtils . add ( this . maxWidths , maxWidth ) ; return this ;
public class CmsSearch { /** * Adds an individual query for a search field that MUST NOT occur . < p > * If this is used , any setting made with { @ link # setQuery ( String ) } and { @ link # setField ( String [ ] ) } * will be ignored and only the individual field search settings will be used . < p > * When combining occurrences of SHOULD , MUST and MUST _ NOT , keep the following in mind : * All SHOULD clauses will be grouped and wrapped in one query , * all MUST and MUST _ NOT clauses will be grouped in another query . * This means that at least one of the terms which are given as a SHOULD query must occur in the * search result . < p > * @ param fieldName the field name * @ param searchQuery the search query * @ since 7.5.1 */ public void addFieldQueryMustNot ( String fieldName , String searchQuery ) { } }
addFieldQuery ( fieldName , searchQuery , BooleanClause . Occur . MUST_NOT ) ;
public class GrammarKeywordAccessFragment2 { /** * Returns all grammars from the hierarchy that are used from rules of this grammar . * @ param grammar the grammar . * @ return the used grammars . */ protected static List < Grammar > getEffectivelyUsedGrammars ( final Grammar grammar ) { } }
final List < AbstractRule > allRules = GrammarUtil . allRules ( grammar ) ; final List < Grammar > map = ListExtensions . < AbstractRule , Grammar > map ( allRules , it -> GrammarUtil . getGrammar ( it ) ) ; final Iterable < Grammar > filter = IterableExtensions . < Grammar > filter ( map , it -> Boolean . valueOf ( it != grammar ) ) ; final Set < Grammar > set = IterableExtensions . < Grammar > toSet ( filter ) ; return IterableExtensions . < Grammar > toList ( set ) ;
public class Handshaker { /** * Select a protocol version from the list . Called from * ServerHandshaker to negotiate protocol version . * Return the lower of the protocol version suggested in the * clien hello and the highest supported by the server . */ ProtocolVersion selectProtocolVersion ( ProtocolVersion protocolVersion ) { } }
if ( activeProtocols == null ) { activeProtocols = getActiveProtocols ( ) ; } return activeProtocols . selectProtocolVersion ( protocolVersion ) ;
public class Functions { /** * Gets the default value for a primitive wrapper . * @ param type * Primitive wrapper type . * @ return The default value . */ public static Object defaultValue ( final Class < ? > type ) { } }
final Object value = WRAPPER_DEFAULTS . get ( Objects . requireNonNull ( type ) ) ; if ( value == null ) { throw new IllegalArgumentException ( "Not primitive wrapper" ) ; } return value ;
public class ImagesInner { /** * Create or update an image . * @ param resourceGroupName The name of the resource group . * @ param imageName The name of the image . * @ param parameters Parameters supplied to the Create Image 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 ImageInner object if successful . */ public ImageInner createOrUpdate ( String resourceGroupName , String imageName , ImageInner parameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , imageName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class Message { /** * Factory method for Message list , returns a list of Message objects with page , size preference * @ param page the page * @ param size the page size * @ return the list * @ throws IOException unexpected error */ public static ResourceList < Message > list ( final int page , final int size ) throws Exception { } }
return list ( BandwidthClient . getInstance ( ) , page , size ) ;
public class Util { /** * Used to adjust a collection toAdjust so that it looks like the collection * newCol . The collection newCol will be unchanged but the result object will * contain a list of added and removed values . * @ param newCol make it look like this * @ param toAdjust if non - null will be adjusted * @ return added and removed values */ public static < T > AdjustCollectionResult < T > adjustCollection ( final Collection < T > newCol , final Collection < T > toAdjust ) { } }
final AdjustCollectionResult < T > acr = new AdjustCollectionResult < > ( ) ; acr . removed = new ArrayList < > ( ) ; acr . added = new ArrayList < > ( ) ; acr . added . addAll ( newCol ) ; if ( toAdjust != null ) { for ( final T ent : toAdjust ) { if ( newCol . contains ( ent ) ) { acr . added . remove ( ent ) ; continue ; } acr . removed . add ( ent ) ; } for ( final T ent : acr . added ) { toAdjust . add ( ent ) ; acr . numAdded ++ ; } for ( final T ent : acr . removed ) { if ( toAdjust . remove ( ent ) ) { acr . numRemoved ++ ; } } } return acr ;
public class PackedBits8 { /** * Appends bits on to the end of the stack . * @ param bits Storage for bits . Relevant bits start at the front . * @ param numberOfBits Number of relevant bits in ' bits ' * @ param swapOrder If true then the first bit in ' bits ' will be the last bit in this array . */ public void append ( int bits , int numberOfBits , boolean swapOrder ) { } }
if ( numberOfBits > 32 ) throw new IllegalArgumentException ( "Number of bits exceeds the size of bits" ) ; int indexTail = size ; growArray ( numberOfBits , true ) ; if ( swapOrder ) { for ( int i = 0 ; i < numberOfBits ; i ++ ) { set ( indexTail + i , ( bits >> i ) & 1 ) ; } } else { for ( int i = 0 ; i < numberOfBits ; i ++ ) { set ( indexTail + numberOfBits - i - 1 , ( bits >> i ) & 1 ) ; } }
public class AndPermission { /** * Get compatible Android 7.0 and lower versions of Uri . * @ param fragment { @ link android . app . Fragment } . * @ param file apk file . * @ return uri . */ public static Uri getFileUri ( android . app . Fragment fragment , File file ) { } }
return getFileUri ( fragment . getActivity ( ) , file ) ;
public class StreamSegmentNameUtils { /** * Checks if the given stream segment name is formatted for a Transaction Segment or regular segment . * @ param streamSegmentName The name of the StreamSegment to check for transaction delimiter . * @ return true if stream segment name contains transaction delimiter , false otherwise . */ public static boolean isTransactionSegment ( String streamSegmentName ) { } }
// Check to see if the given name is a properly formatted Transaction . int endOfStreamNamePos = streamSegmentName . lastIndexOf ( TRANSACTION_DELIMITER ) ; if ( endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER . length ( ) + TRANSACTION_ID_LENGTH > streamSegmentName . length ( ) ) { return false ; } return true ;
public class RequestTracker { /** * Add new request to the tracking * @ param sRequestID * The unique request ID . * @ param aRequestScope * The request scope itself . */ public static void addRequest ( @ Nonnull @ Nonempty final String sRequestID , @ Nonnull final IRequestWebScope aRequestScope ) { } }
getInstance ( ) . m_aRequestTrackingMgr . addRequest ( sRequestID , aRequestScope , s_aParallelRunningCallbacks ) ;
public class StochasticUtils { /** * - - - - - AVERAGES - - - - - */ public static < T extends Number > double getAverage ( Collection < T > values , AVERAGE_TYPE type ) { } }
switch ( type ) { case ARITHMETIC : double sum = 0.0 ; for ( T t : values ) { sum += t . doubleValue ( ) ; } return sum / values . size ( ) ; default : throw new IllegalArgumentException ( "\"" + type + "\" is not a valid verage-type!" ) ; }
public class DdlUtilsDataHandling { /** * Returns the sql necessary to add the data XML contained in the given input stream . * Note that the data is expected to match the repository metadata ( not the table schema ) . * Also note that you should not use the reader after passing it to this method except closing * it ( which is not done automatically ) . * @ param input A reader returning the content of the data file * @ param batchSize The batch size ; use 1 for not batch insertion */ public void insertData ( Reader input , int batchSize ) throws DataTaskException { } }
try { DataSet set = ( DataSet ) _digester . parse ( input ) ; set . insert ( _platform , _dbModel , batchSize ) ; } catch ( Exception ex ) { if ( ex instanceof DataTaskException ) { // is not declared by digester , but may be thrown throw ( DataTaskException ) ex ; } else { throw new DataTaskException ( ex ) ; } }
public class GeoDistance { /** * { @ inheritDoc } */ @ Override public int compareTo ( GeoDistance other ) { } }
return Double . valueOf ( getValue ( GeoDistanceUnit . MILLIMETRES ) ) . compareTo ( other . getValue ( GeoDistanceUnit . MILLIMETRES ) ) ;
public class ResumingStreamingResultScanner { /** * { @ inheritDoc } */ @ Override public final FlatRow [ ] next ( int count ) throws IOException { } }
ArrayList < FlatRow > resultList = new ArrayList < > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { FlatRow row = next ( ) ; if ( row == null ) { break ; } resultList . add ( row ) ; } return resultList . toArray ( new FlatRow [ resultList . size ( ) ] ) ;
public class Page { /** * It ' s IE if int > = 0 * Use int found in " ieVersion " * Official IE 7 * Mozilla / 4.0 ( compatible ; MSIE 7.0 ; Windows NT 5.1 ; . NET CLR 1.1.4322; * . NET CLR 2.0.50727 ; . NET CLR 3.0.4506.2152 ; . NET CLR 3.5.30729) * Official IE 8 * Mozilla / 4.0 ( compatible ; MSIE 8.0 ; Windows NT 6.1 ; WOW64 ; Trident / 4.0 ; SLCC2; * . NET CLR 2.0.50727 ; . NET CLR 3.5.30729 ; . NET CLR 3.0.30729 ; Media Center PC 6.0 ; . NET4.0C ; . NET4.0E ; ATT ) * IE 11 Compatibility * Mozilla / 4.0 ( compatible ; MSIE 7.0 ; Windows NT 6.1 ; SLCC2 ; . NET CLR 2.0.50727; * . NET CLR 3.5.30729 ; . NET CLR 3.0.30729 ; Media Center PC 6.0 ; . NET CLR 1.1.4322 ; . NET4.0C ; . NET4.0E ; InfoPath . 3 ; HVD ; ATT ) * IE 11 ( not Compatiblity ) * Mozilla / 4.0 ( compatible ; MSIE 8.0 ; Windows NT 6.1 ; Trident / 4.0 ; SLCC2 ; . NET CLR 2.0.50727; * . NET CLR 3.5.30729 ; . NET CLR 3.0.30729 ; Media Center PC 6.0 ; . NET CLR 1.1.4322 ; . NET4.0C ; . NET4.0E ; InfoPath . 3 ; HVD ; ATT ) * @ param trans * @ return */ public static BROWSER browser ( AuthzTrans trans , Slot slot ) { } }
BROWSER br = trans . get ( slot , null ) ; if ( br == null ) { String agent = trans . agent ( ) ; int msie ; if ( agent . contains ( "iPhone" ) /* other phones ? */ ) { br = BROWSER . iPhone ; } else if ( ( msie = agent . indexOf ( "MSIE" ) ) >= 0 ) { msie += 5 ; int end = agent . indexOf ( ";" , msie ) ; float ver ; try { ver = Float . valueOf ( agent . substring ( msie , end ) ) ; br = ver < 8f ? BROWSER . ieOld : BROWSER . ie ; } catch ( Exception e ) { br = BROWSER . ie ; } } else { br = BROWSER . html5 ; } trans . put ( slot , br ) ; } return br ;
public class A_CmsListExplorerDialog { /** * Adds the standard explorer view columns to the list . < p > * @ see org . opencms . workplace . list . A _ CmsListDialog # setColumns ( org . opencms . workplace . list . CmsListMetadata ) */ @ Override protected void setColumns ( CmsListMetadata metadata ) { } }
setColumnVisibilities ( ) ; // position 0 : icon CmsListColumnDefinition typeIconCol = new CmsListColumnDefinition ( LIST_COLUMN_TYPEICON ) ; typeIconCol . setName ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_ICON_0 ) ) ; typeIconCol . setHelpText ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_ICON_HELP_0 ) ) ; typeIconCol . setWidth ( "20" ) ; typeIconCol . setAlign ( CmsListColumnAlignEnum . ALIGN_CENTER ) ; typeIconCol . setListItemComparator ( new CmsListItemActionIconComparator ( ) ) ; // add resource icon action CmsListDirectAction resourceTypeIconAction = new CmsListResourceTypeIconAction ( LIST_ACTION_TYPEICON ) ; resourceTypeIconAction . setEnabled ( false ) ; typeIconCol . addDirectAction ( resourceTypeIconAction ) ; metadata . addColumn ( typeIconCol ) ; // position 1 : edit button CmsListColumnDefinition editIconCol = new CmsListColumnDefinition ( LIST_COLUMN_EDIT ) ; editIconCol . setName ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_EDIT_0 ) ) ; editIconCol . setHelpText ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_EDIT_HELP_0 ) ) ; editIconCol . setWidth ( "20" ) ; editIconCol . setAlign ( CmsListColumnAlignEnum . ALIGN_CENTER ) ; // add enabled edit action CmsListDirectAction editAction = new CmsListEditResourceAction ( LIST_ACTION_EDIT , LIST_COLUMN_NAME ) ; editAction . setEnabled ( true ) ; editIconCol . addDirectAction ( editAction ) ; // add disabled edit action CmsListDirectAction noEditAction = new CmsListEditResourceAction ( LIST_ACTION_EDIT + "d" , LIST_COLUMN_NAME ) ; noEditAction . setEnabled ( false ) ; editIconCol . addDirectAction ( noEditAction ) ; metadata . addColumn ( editIconCol ) ; // position 2 : lock icon CmsListColumnDefinition lockIconCol = new CmsListColumnDefinition ( LIST_COLUMN_LOCKICON ) ; lockIconCol . setName ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_LOCK_0 ) ) ; lockIconCol . setWidth ( "20" ) ; lockIconCol . setAlign ( CmsListColumnAlignEnum . ALIGN_CENTER ) ; lockIconCol . setListItemComparator ( new CmsListItemActionIconComparator ( ) ) ; // add lock icon action CmsListDirectAction resourceLockIconAction = new CmsListResourceLockAction ( LIST_ACTION_LOCKICON ) ; resourceLockIconAction . setEnabled ( false ) ; lockIconCol . addDirectAction ( resourceLockIconAction ) ; metadata . addColumn ( lockIconCol ) ; // position 3 : project state icon , resource is inside or outside current project CmsListColumnDefinition projStateIconCol = new CmsListColumnDefinition ( LIST_COLUMN_PROJSTATEICON ) ; projStateIconCol . setName ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_PROJSTATE_0 ) ) ; projStateIconCol . setWidth ( "20" ) ; // add resource icon action CmsListDirectAction resourceProjStateAction = new CmsListResourceProjStateAction ( LIST_ACTION_PROJSTATEICON ) ; resourceProjStateAction . setEnabled ( false ) ; projStateIconCol . addDirectAction ( resourceProjStateAction ) ; metadata . addColumn ( projStateIconCol ) ; // position 4 : name CmsListColumnDefinition nameCol = new CmsListExplorerColumn ( LIST_COLUMN_NAME ) ; nameCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_PATH_0 ) ) ; // add resource open action CmsListDefaultAction resourceOpenDefAction = new CmsListOpenResourceAction ( LIST_DEFACTION_OPEN , LIST_COLUMN_ROOT_PATH ) ; resourceOpenDefAction . setEnabled ( true ) ; nameCol . addDefaultAction ( resourceOpenDefAction ) ; metadata . addColumn ( nameCol ) ; nameCol . setPrintable ( false ) ; // position 4 : root path for printing CmsListColumnDefinition rootPathCol = new CmsListExplorerColumn ( LIST_COLUMN_ROOT_PATH ) ; rootPathCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_NAME_0 ) ) ; rootPathCol . setVisible ( false ) ; rootPathCol . setPrintable ( true ) ; metadata . addColumn ( rootPathCol ) ; // position 5 : title CmsListColumnDefinition titleCol = new CmsListExplorerColumn ( LIST_COLUMN_TITLE ) ; titleCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_TITLE_0 ) ) ; metadata . addColumn ( titleCol ) ; // position 6 : resource type CmsListColumnDefinition typeCol = new CmsListExplorerColumn ( LIST_COLUMN_TYPE ) ; typeCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_TYPE_0 ) ) ; metadata . addColumn ( typeCol ) ; // position 7 : size CmsListColumnDefinition sizeCol = new CmsListExplorerColumn ( LIST_COLUMN_SIZE ) ; sizeCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_SIZE_0 ) ) ; metadata . addColumn ( sizeCol ) ; // position 8 : permissions CmsListColumnDefinition permissionsCol = new CmsListExplorerColumn ( LIST_COLUMN_PERMISSIONS ) ; permissionsCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_PERMISSIONS_0 ) ) ; metadata . addColumn ( permissionsCol ) ; // position 9 : date of last modification CmsListColumnDefinition dateLastModCol = new CmsListExplorerColumn ( LIST_COLUMN_DATELASTMOD ) ; dateLastModCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_DATELASTMODIFIED_0 ) ) ; dateLastModCol . setFormatter ( CmsListDateMacroFormatter . getDefaultDateFormatter ( ) ) ; metadata . addColumn ( dateLastModCol ) ; // position 10 : user who last modified the resource CmsListColumnDefinition userLastModCol = new CmsListExplorerColumn ( LIST_COLUMN_USERLASTMOD ) ; userLastModCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_USERLASTMODIFIED_0 ) ) ; metadata . addColumn ( userLastModCol ) ; // position 11 : date of creation CmsListColumnDefinition dateCreateCol = new CmsListExplorerColumn ( LIST_COLUMN_DATECREATE ) ; dateCreateCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_DATECREATED_0 ) ) ; dateCreateCol . setFormatter ( CmsListDateMacroFormatter . getDefaultDateFormatter ( ) ) ; metadata . addColumn ( dateCreateCol ) ; // position 12 : user who created the resource CmsListColumnDefinition userCreateCol = new CmsListExplorerColumn ( LIST_COLUMN_USERCREATE ) ; userCreateCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_USERCREATED_0 ) ) ; metadata . addColumn ( userCreateCol ) ; // position 13 : date of release CmsListColumnDefinition dateReleaseCol = new CmsListExplorerColumn ( LIST_COLUMN_DATEREL ) ; dateReleaseCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_DATERELEASED_0 ) ) ; dateReleaseCol . setFormatter ( new CmsListDateMacroFormatter ( Messages . get ( ) . container ( Messages . GUI_LIST_DATE_FORMAT_1 ) , new CmsMessageContainer ( null , CmsTouch . DEFAULT_DATE_STRING ) , CmsResource . DATE_RELEASED_DEFAULT ) ) ; metadata . addColumn ( dateReleaseCol ) ; // position 14 : date of expiration CmsListColumnDefinition dateExpirationCol = new CmsListExplorerColumn ( LIST_COLUMN_DATEEXP ) ; dateExpirationCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_DATEEXPIRED_0 ) ) ; dateExpirationCol . setFormatter ( new CmsListDateMacroFormatter ( Messages . get ( ) . container ( Messages . GUI_LIST_DATE_FORMAT_1 ) , new CmsMessageContainer ( null , CmsTouch . DEFAULT_DATE_STRING ) , CmsResource . DATE_EXPIRED_DEFAULT ) ) ; metadata . addColumn ( dateExpirationCol ) ; // position 15 : state ( changed , unchanged , new , deleted ) CmsListColumnDefinition stateCol = new CmsListExplorerColumn ( LIST_COLUMN_STATE ) ; stateCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_STATE_0 ) ) ; metadata . addColumn ( stateCol ) ; // position 16 : locked by CmsListColumnDefinition lockedByCol = new CmsListExplorerColumn ( LIST_COLUMN_LOCKEDBY ) ; lockedByCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_INPUT_LOCKEDBY_0 ) ) ; metadata . addColumn ( lockedByCol ) ; // position 17 : site CmsListColumnDefinition siteCol = new CmsListExplorerColumn ( LIST_COLUMN_SITE ) ; siteCol . setName ( org . opencms . workplace . explorer . Messages . get ( ) . container ( org . opencms . workplace . explorer . Messages . GUI_LABEL_SITE_0 ) ) ; metadata . addColumn ( siteCol ) ;
public class HttpChain { /** * Stop this chain . The chain will have to be recreated when port is updated * notification / follow - on of stop operation is in the chainStopped listener method . */ @ FFDCIgnore ( InvalidRuntimeStateException . class ) public synchronized void stop ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "stop chain " + this ) ; } // When the chain is being stopped , remove the previously // registered EndPoint created in update endpointMgr . removeEndPoint ( endpointName ) ; // We don ' t have to check enabled / disabled here : chains are always allowed to stop . if ( currentConfig == null || chainState . get ( ) <= ChainState . QUIESCED . val ) return ; // Quiesce and then stop the chain . The CFW internally uses a StopTimer for // the quiesce / stop operation - - the listener method will be called when the chain // has stopped . So to see what happens next , visit chainStopped try { ChainData cd = cfw . getChain ( chainName ) ; if ( cd != null ) { cfw . stopChain ( cd , cfw . getDefaultChainQuiesceTimeout ( ) ) ; stopWait . waitForStop ( cfw . getDefaultChainQuiesceTimeout ( ) , this ) ; // BLOCK try { cfw . destroyChain ( cd ) ; cfw . removeChain ( cd ) ; } catch ( InvalidRuntimeStateException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Error destroying or removing chain " + chainName , this , e ) ; } } } } catch ( ChannelException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Error stopping chain " + chainName , this , e ) ; } } catch ( ChainException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Error stopping chain " + chainName , this , e ) ; } }
public class ToolUtils { /** * Finds strings similar to a string the user has entered and then * generates a " Did you mean one of these " message * @ param available all possibilities * @ param it the string the user has entered * @ return the " Did you mean . . . " string */ public static String getDidYouMeanString ( Collection < String > available , String it ) { } }
String message = "" ; Collection < String > mins = Levenshtein . findSimilar ( available , it ) ; if ( mins . size ( ) > 0 ) { if ( mins . size ( ) == 1 ) { message += "Did you mean this?" ; } else { message += "Did you mean one of these?" ; } for ( String m : mins ) { message += "\n\t" + m ; } } return message ;
public class SchemaBasedPartitionedDataWriterBuilder { /** * Use the name field of { @ link # schema } to partition path */ @ Override protected String getPartitionedFileName ( State properties , String originalFileName ) { } }
Schema schema = this . getSchema ( ) ; if ( schema != null ) { return new Path ( schema . getName ( ) , originalFileName ) . toString ( ) ; } else { return originalFileName ; }
public class HttpServerBuilder { /** * Defines a ZIP resource on the classpath that provides the static content the server should host . * @ param contextRoot * the root path to the content * @ param contentResource * the name of the classpath resource denoting a file that should be hosted . If the file denotes a zip file , its * content is hosted instead of the file itself . * The path may be absolute or relative to the caller of the method . * @ return * this builder */ public HttpServerBuilder contentFrom ( String contextRoot , String contentResource ) { } }
URL resource = resolver . resolve ( contentResource , CallStack . getCallerClass ( ) ) ; resources . put ( contextRoot , resource ) ; return this ;
public class Task { /** * Set an enterprise field value . * @ param index field index * @ param value field value */ public void setEnterpriseDate ( int index , Date value ) { } }
set ( selectField ( TaskFieldLists . ENTERPRISE_DATE , index ) , value ) ;
public class GoldUtils { /** * Writes a gouldi entry to the given path . Note that if the file already exists , it will be * overwritten and logging a warning message . * @ param outputPath where the gouldi entry will be stored * @ param goldEntry the gouldi entry as java object * @ throws IOException */ public static void writeGoldFile ( Path outputPath , JsonGouldiBean goldEntry ) { } }
try { try { Files . createFile ( outputPath ) ; } catch ( FileAlreadyExistsException e ) { LOG . warn ( "File already exists!" ) ; } try ( Writer out = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( outputPath . toFile ( ) ) , "UTF-8" ) ) ) { out . write ( goldEntry . toString ( ) ) ; } } catch ( IOException e ) { LOG . error ( e ) ; throw new RuntimeException ( e ) ; }
public class SoapServerFaultResponseActionBuilder { /** * Sets the attachment with content resource . * @ param contentId * @ param contentType * @ param contentResource * @ param charset * @ return */ public SoapServerFaultResponseActionBuilder attachment ( String contentId , String contentType , Resource contentResource , Charset charset ) { } }
SoapAttachment attachment = new SoapAttachment ( ) ; attachment . setContentId ( contentId ) ; attachment . setContentType ( contentType ) ; try { attachment . setContent ( FileUtils . readToString ( contentResource , charset ) ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Failed to read attachment resource" , e ) ; } getAction ( ) . getAttachments ( ) . add ( attachment ) ; return this ;
public class EngineeringObjectModelWrapper { /** * Generates the model description of a field which is annotated with the OpenEngSBForeignKey annotation . */ private ModelDescription getModelDescriptionFromField ( Field field ) { } }
OpenEngSBForeignKey key = field . getAnnotation ( OpenEngSBForeignKey . class ) ; ModelDescription description = new ModelDescription ( key . modelType ( ) , key . modelVersion ( ) ) ; return description ;
public class NlsAccess { /** * This method sets ( overrides ) the { @ link NlsMessageFactory } . This allows to exchange the { @ link NlsMessageFactory } * and thereby the implementation of { @ link net . sf . mmm . util . nls . api . NlsMessage } . < br > * The desired behavior of a universal translator can depend from the situation where it is used . E . g . a client * application could use the { @ link java . util . Locale # getDefault ( ) " default locale " } to choose the destination * language . In a multi - user server application a { @ link ThreadLocal } may be used to retrieve the appropriate * { @ link java . util . Locale locale } . < br > * < b > WARNING : < / b > < br > * This is only a back - door for simple applications or test situations . Please try to avoid using this feature as well * as { @ link net . sf . mmm . util . nls . api . NlsMessage # getLocalizedMessage ( ) } and solve this issue with IoC strategies ( using * non - final static fields like here is evil ) . < br > * < b > ATTENTION : < / b > < br > * No synchronization is performed setting the factory instance . This assumes that an assignment is an atomic * operation in the JVM you are using . Additionally this method should only be invoked in the initialization phase of * your application . * @ param factory the factory - instance to use . */ public static void setFactory ( NlsMessageFactory factory ) { } }
if ( NlsAccess . factory == null ) { NlsAccess . factory = factory ; } else if ( NlsAccess . factory != factory ) { LOG . warn ( "NlsTemplateResolver is already set to {} and will not be changed to {}." , NlsAccess . factory , factory ) ; }
public class LightMetaBean { /** * finds constructor which matches types exactly */ private static < T extends Bean > Constructor < T > findConstructor ( Class < T > beanType , List < Class < ? > > propertyTypes ) { } }
Class < ? > [ ] types = propertyTypes . toArray ( new Class < ? > [ propertyTypes . size ( ) ] ) ; try { Constructor < T > con = beanType . getDeclaredConstructor ( types ) ; return con ; } catch ( NoSuchMethodException ex ) { // try a more lenient search // this handles cases where field is a concrete class and constructor is an interface @ SuppressWarnings ( "unchecked" ) Constructor < T > [ ] cons = ( Constructor < T > [ ] ) beanType . getDeclaredConstructors ( ) ; Constructor < T > match = null ; for ( int i = 0 ; i < cons . length ; i ++ ) { Constructor < T > con = cons [ i ] ; Class < ? > [ ] conTypes = con . getParameterTypes ( ) ; if ( conTypes . length == types . length ) { for ( int j = 0 ; j < types . length ; j ++ ) { if ( ! conTypes [ j ] . isAssignableFrom ( types [ j ] ) ) { break ; } } if ( match != null ) { throw new UnsupportedOperationException ( "Unable to find constructor: More than one matches" ) ; } match = con ; } } if ( match == null ) { String msg = "Unable to find constructor: " + beanType . getSimpleName ( ) + "(" ; for ( Class < ? > type : types ) { msg += Objects . toString ( type . getName ( ) , "<null>" ) ; } msg += ")" ; throw new UnsupportedOperationException ( msg , ex ) ; } return match ; }
public class GVRFutureOnGlThread { /** * To get the result we get from run ( ) . With timeout request . * @ param timeout * The timeout number . * @ param unit * The time unit bound to timeout number . * @ return The result from the Callable we put in . * @ throws InterruptedException * When this thread is interrupted while waiting . * @ throws CancellationException * When the callable task got successfully cancelled . * @ throws TimeOutException * When the execution of the callable call ( ) out of timeout * limitation . */ @ Override public T get ( long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { } }
synchronized ( lock ) { if ( mIsCancelled ) { throw new CancellationException ( "The task on GVRFutureOnGlThread has already been cancelled." ) ; } if ( mIsDone ) { return t ; } if ( unit == null ) { lock . wait ( ) ; } else { lock . wait ( unit . convert ( timeout , TimeUnit . MILLISECONDS ) ) ; } if ( mIsCancelled ) { throw new CancellationException ( "The task on GVRFutureOnGlThread has already been cancelled." ) ; } if ( ! mIsDone ) { throw new TimeoutException ( "Request time out for" + unit . convert ( timeout , TimeUnit . MILLISECONDS ) + "ms" ) ; } return t ; }
public class GasteigerMarsiliPartialCharges { /** * Main method which assigns Gasteiger Marisili partial sigma charges . * @ param ac AtomContainer * @ param setCharge The Charge * @ return AtomContainer with partial charges * @ exception Exception Possible Exceptions */ public IAtomContainer assignGasteigerMarsiliSigmaPartialCharges ( IAtomContainer ac , boolean setCharge ) throws Exception { } }
// if ( setCharge ) { // atomTypeCharges . setCharges ( ac ) ; / / not necessary initial charge /* add the initial charge to 0 . According results of Gasteiger */ for ( int i = 0 ; i < ac . getAtomCount ( ) ; i ++ ) ac . getAtom ( i ) . setCharge ( 0.0 ) ; double [ ] gasteigerFactors = assignGasteigerSigmaMarsiliFactors ( ac ) ; // a , b , c , deoc , chi , q double alpha = 1.0 ; double q ; double deoc ; IAtom [ ] atoms = null ; int atom1 = 0 ; int atom2 = 0 ; double [ ] q_old = new double [ ac . getAtomCount ( ) ] ; for ( int i = 0 ; i < q_old . length ; i ++ ) q_old [ 0 ] = 20.0 ; out : for ( int i = 0 ; i < MX_ITERATIONS ; i ++ ) { alpha *= MX_DAMP ; boolean isDifferent = false ; for ( int j = 0 ; j < ac . getAtomCount ( ) ; j ++ ) { q = gasteigerFactors [ STEP_SIZE * j + j + 5 ] ; double difference = Math . abs ( q_old [ j ] ) - Math . abs ( q ) ; if ( Math . abs ( difference ) > 0.001 ) isDifferent = true ; q_old [ j ] = q ; gasteigerFactors [ STEP_SIZE * j + j + 4 ] = gasteigerFactors [ STEP_SIZE * j + j + 2 ] * q * q + gasteigerFactors [ STEP_SIZE * j + j + 1 ] * q + gasteigerFactors [ STEP_SIZE * j + j ] ; // logger . debug ( " g4 : " + gasteigerFactors [ STEP _ SIZE * j + j + 4 ] ) ; } if ( ! isDifferent ) /* automatically break the maximum iterations */ break out ; // bonds = ac . getBonds ( ) ; Iterator < IBond > bonds = ac . bonds ( ) . iterator ( ) ; while ( bonds . hasNext ( ) ) { IBond bond = ( IBond ) bonds . next ( ) ; atom1 = ac . indexOf ( bond . getBegin ( ) ) ; atom2 = ac . indexOf ( bond . getEnd ( ) ) ; if ( gasteigerFactors [ STEP_SIZE * atom1 + atom1 + 4 ] >= gasteigerFactors [ STEP_SIZE * atom2 + atom2 + 4 ] ) { if ( ac . getAtom ( atom2 ) . getSymbol ( ) . equals ( "H" ) ) { deoc = DEOC_HYDROGEN ; } else { deoc = gasteigerFactors [ STEP_SIZE * atom2 + atom2 + 3 ] ; } } else { if ( ac . getAtom ( atom1 ) . getSymbol ( ) . equals ( "H" ) ) { deoc = DEOC_HYDROGEN ; } else { deoc = gasteigerFactors [ STEP_SIZE * atom1 + atom1 + 3 ] ; } } q = ( gasteigerFactors [ STEP_SIZE * atom1 + atom1 + 4 ] - gasteigerFactors [ STEP_SIZE * atom2 + atom2 + 4 ] ) / deoc ; // logger . debug ( " qq : " + q ) ; gasteigerFactors [ STEP_SIZE * atom1 + atom1 + 5 ] -= ( q * alpha ) ; gasteigerFactors [ STEP_SIZE * atom2 + atom2 + 5 ] += ( q * alpha ) ; } } for ( int i = 0 ; i < ac . getAtomCount ( ) ; i ++ ) { ac . getAtom ( i ) . setCharge ( gasteigerFactors [ STEP_SIZE * i + i + 5 ] ) ; } return ac ;
public class MLUInt8 { /** * Casts < code > Double [ ] < / code > to < code > byte [ ] < / code > * @ param - source < code > Byte [ ] < / code > * @ return - result < code > byte [ ] < / code > */ private static Byte [ ] castToByte ( byte [ ] d ) { } }
Byte [ ] dest = new Byte [ d . length ] ; for ( int i = 0 ; i < d . length ; i ++ ) { dest [ i ] = ( byte ) d [ i ] ; } return dest ;
public class RenderingIntentImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . RENDERING_INTENT__RESERVED : setReserved ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__IOCARI : setIOCARI ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__OCRI : setOCRI ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__PTOCRI : setPTOCRI ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__GOCARI : setGOCARI ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__RESERVED2 : setReserved2 ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class ODataRendererUtils { /** * This method returns odata context based on oDataUri . * Throws ODataRenderException in case context is not defined . * @ param entityDataModel The entity data model . * @ param oDataUri is object which is the root of an abstract syntax tree that describes * @ return string that represents context * @ throws ODataRenderException if unable to get context from url */ public static String getContextURL ( ODataUri oDataUri , EntityDataModel entityDataModel ) throws ODataRenderException { } }
return getContextURL ( oDataUri , entityDataModel , false ) ;
public class Dao { /** * Creates a raw query and enables auto updates for the given single table * @ param table the affected table . updates get triggered if the observed tables changes . Use * { @ code null } or * { @ link # rawQuery ( String ) } if you don ' t want to register for automatic updates * @ param sql The sql query statement */ protected QueryBuilder rawQuery ( @ Nullable final String table , @ NonNull String sql ) { } }
return rawQueryOnManyTables ( table == null ? null : Collections . singleton ( table ) , sql ) ;
public class LiveData { /** * Posts a task to a main thread to set the given value . So if you have a following code * executed in the main thread : * < pre class = " prettyprint " > * liveData . postValue ( " a " ) ; * liveData . setValue ( " b " ) ; * < / pre > * The value " b " would be set at first and later the main thread would override it with * the value " a " . * If you called this method multiple times before a main thread executed a posted task , only * the last value would be dispatched . * @ param value The new value */ protected void postValue ( T value ) { } }
boolean postTask ; synchronized ( mDataLock ) { postTask = mPendingData == NOT_SET ; mPendingData = value ; } if ( ! postTask ) { return ; } ArchTaskExecutor . getInstance ( ) . postToMainThread ( mPostValueRunnable ) ;
public class PlacesInterface { /** * Get informations about a place . * This method does not require authentication . * @ param placeId * A Flickr Places ID . Optional , can be null . ( While optional , you must pass either a valid Places ID or a WOE ID . ) * @ param woeId * A Where On Earth ( WOE ) ID . Optional , can be null . ( While optional , you must pass either a valid Places ID or a WOE ID . ) * @ return A Location * @ throws FlickrException */ public Location getInfo ( String placeId , String woeId ) throws FlickrException { } }
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INFO ) ; if ( placeId != null ) { parameters . put ( "place_id" , placeId ) ; } if ( woeId != null ) { parameters . put ( "woe_id" , woeId ) ; } Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element locationElement = response . getPayload ( ) ; return parseLocation ( locationElement ) ;
public class UpdateCommand { /** * Sends a update message to a Cadmium site . This method will block until the update is complete . * @ param site2 The uri to a Cadmium site . * @ param repo The git repository to tell the site to change to . * @ param branch The branch to switch to . * @ param revision The revision to reset to . * @ param comment The message to record with this event in the history on the Cadmium site . * @ param token The Github API token to authenticate with . * @ return true if successfull or false otherwise . * @ throws Exception */ public static boolean sendUpdateMessage ( String site2 , String repo , String branch , String revision , String comment , String token ) throws Exception { } }
return sendUpdateMessage ( site2 , repo , branch , revision , comment , token , UPDATE_ENDPOINT ) ;
public class BlockThreadManager { /** * Add a BlockEncodeRequest to the manager . This will immediately attempt * to assign a request to an encoding thread ( which may not occur if no * threads are currently available ) . Requests are passed back to the * currently set FLACEncoder object when finished and ready to be written * to output . * @ param ber Block request to encode * @ return boolean true if block added , false if an error occured . */ synchronized public boolean addRequest ( BlockEncodeRequest ber ) { } }
// add request to the manager ( requests are automatically removed when complete ) process = true ; boolean r = true ; try { unassignedEncodeRequests . put ( ber ) ; synchronized ( outstandingCountLock ) { outstandingCount ++ ; } startFrameThreads ( ) ; } catch ( InterruptedException e ) { r = false ; Thread . currentThread ( ) . interrupt ( ) ; } return r ;
public class JSONTokener { /** * Returns the string up to but not including any of the given characters or * a newline character . This does not consume the excluded character . */ private String nextToInternal ( String excluded ) { } }
int start = pos ; for ( ; pos < in . length ( ) ; pos ++ ) { char c = in . charAt ( pos ) ; if ( c == '\r' || c == '\n' || excluded . indexOf ( c ) != - 1 ) { return in . substring ( start , pos ) ; } } return in . substring ( start ) ;
public class MemberSummaryBuilder { /** * Build the summary for the optional members . * @ param node the XML element that specifies which components to document * @ param memberSummaryTree the content tree to which the documentation will be added */ public void buildAnnotationTypeRequiredMemberSummary ( XMLNode node , Content memberSummaryTree ) { } }
MemberSummaryWriter writer = memberSummaryWriters . get ( VisibleMemberMap . Kind . ANNOTATION_TYPE_MEMBER_REQUIRED ) ; VisibleMemberMap visibleMemberMap = getVisibleMemberMap ( VisibleMemberMap . Kind . ANNOTATION_TYPE_MEMBER_REQUIRED ) ; addSummary ( writer , visibleMemberMap , false , memberSummaryTree ) ;
public class ComplexNumber { /** * Adds the complex number with a scalar value . * @ param z1 Complex Number . * @ param scalar Scalar value . * @ return Returns new ComplexNumber instance containing the add of specified complex number with scalar value . */ public static ComplexNumber Add ( ComplexNumber z1 , double scalar ) { } }
return new ComplexNumber ( z1 . real + scalar , z1 . imaginary ) ;
public class BaseTraceService { /** * Based on config ( sourceList ) , need to connect the synchronized handler to configured source / conduit . . * Or disconnect it . */ private void updateConduitSyncHandlerConnection ( List < String > sourceList , SynchronousHandler handler ) { } }
if ( sourceList . contains ( "message" ) ) { logConduit . addSyncHandler ( handler ) ; } else { logConduit . removeSyncHandler ( handler ) ; } if ( sourceList . contains ( "trace" ) ) { traceConduit . addSyncHandler ( handler ) ; } else { traceConduit . removeSyncHandler ( handler ) ; }
public class CPInstancePersistenceImpl { /** * Returns a range of all the cp instances where CPDefinitionId = & # 63 ; and displayDate & lt ; & # 63 ; and status = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CPInstanceModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param CPDefinitionId the cp definition ID * @ param displayDate the display date * @ param status the status * @ param start the lower bound of the range of cp instances * @ param end the upper bound of the range of cp instances ( not inclusive ) * @ return the range of matching cp instances */ @ Override public List < CPInstance > findByC_LtD_S ( long CPDefinitionId , Date displayDate , int status , int start , int end ) { } }
return findByC_LtD_S ( CPDefinitionId , displayDate , status , start , end , null ) ;
public class ListFunctionsResult { /** * A list of Lambda functions . * @ param functions * A list of Lambda functions . */ public void setFunctions ( java . util . Collection < FunctionConfiguration > functions ) { } }
if ( functions == null ) { this . functions = null ; return ; } this . functions = new com . amazonaws . internal . SdkInternalList < FunctionConfiguration > ( functions ) ;
public class InjectorConfiguration { /** * Specify that the given class should be created using the factory instance specified . * @ param classDefinition the class that should be produced using a factory . * @ param factory the factory class that creates the class definition * @ param < T > type of the class * @ return a modified copy of this injection configuration . */ public < T > InjectorConfiguration withFactory ( Class < T > classDefinition , Provider < T > factory ) { } }
if ( classDefinition . equals ( Injector . class ) ) { throw new DependencyInjectionFailedException ( "Cowardly refusing to define a global factory for Injector since that would lead to a Service Locator pattern. If you need the injector, please define it on a per-class or per-method basis." ) ; } // noinspection unchecked return new InjectorConfiguration ( scopes , definedClasses , factories . withModified ( ( value ) -> value . with ( classDefinition , factory ) ) , factoryClasses , sharedClasses , sharedInstances , aliases , collectedAliases , namedParameterValues ) ;
public class BeaconEvent { /** * Utility method to parse e generic event to a more specific one * @ param event the generic event to parse * @ return an option containing the parsed value or non if it could not be parsed */ public static Optional < BeaconEvent > parse ( Event event ) { } }
Matcher matcher = PATTERN . matcher ( event . getTag ( ) ) ; if ( matcher . matches ( ) ) { BeaconEvent result = new BeaconEvent ( matcher . group ( 1 ) , matcher . group ( 2 ) , matcher . group ( 3 ) , event . getData ( JsonElement . class ) ) ; return Optional . of ( result ) ; } else { return Optional . empty ( ) ; }
public class SerialInterrupt { /** * Java consumer code can all this method to unregister itself as a listener for pin state * changes . * @ see com . pi4j . jni . SerialInterruptListener * @ see com . pi4j . jni . SerialInterruptEvent * @ param fileDescriptor the serial file descriptor / handle */ public static synchronized void removeListener ( int fileDescriptor ) { } }
if ( listeners . containsKey ( fileDescriptor ) ) { listeners . remove ( fileDescriptor ) ; disableSerialDataReceiveCallback ( fileDescriptor ) ; }
public class TopoGraph { /** * Sets a user index value for a half edge */ void setHalfEdgeUserIndex ( int half_edge , int index , int value ) { } }
int i = getHalfEdgeIndex_ ( half_edge ) ; AttributeStreamOfInt32 stream = m_edgeIndices . get ( index ) ; if ( stream . size ( ) <= i ) stream . resize ( m_halfEdgeData . size ( ) , - 1 ) ; stream . write ( i , value ) ;
public class AccountsInner { /** * Gets the first page of Data Lake Analytics accounts , if any , within the current subscription . This includes a link to the next page , if any . * @ param filter OData filter . Optional . * @ param top The number of items to return . Optional . * @ param skip The number of items to skip over before returning elements . Optional . * @ param select OData Select statement . Limits the properties on each entry to just those requested , e . g . Categories ? $ select = CategoryName , Description . Optional . * @ param orderby OrderBy clause . One or more comma - separated expressions with an optional " asc " ( the default ) or " desc " depending on the order you ' d like the values sorted , e . g . Categories ? $ orderby = CategoryName desc . Optional . * @ param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response , e . g . Categories ? $ count = true . Optional . * @ 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 PagedList & lt ; DataLakeAnalyticsAccountBasicInner & gt ; object if successful . */ public PagedList < DataLakeAnalyticsAccountBasicInner > list ( final String filter , final Integer top , final Integer skip , final String select , final String orderby , final Boolean count ) { } }
ServiceResponse < Page < DataLakeAnalyticsAccountBasicInner > > response = listSinglePageAsync ( filter , top , skip , select , orderby , count ) . toBlocking ( ) . single ( ) ; return new PagedList < DataLakeAnalyticsAccountBasicInner > ( response . body ( ) ) { @ Override public Page < DataLakeAnalyticsAccountBasicInner > nextPage ( String nextPageLink ) { return listNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class DistributedFileSystem { /** * Start lease recovery * @ param f the name of the file to start lease recovery * @ return if the file is closed or not * @ throws IOException */ @ Deprecated public boolean recoverLease ( Path f ) throws IOException { } }
return dfs . recoverLease ( getPathName ( f ) , false ) ;
public class SeleniumSpec { /** * Verifies that a webelement previously found has { @ code attribute } with { @ code value } ( as a regexp ) * @ param index * @ param attribute * @ param value */ @ Then ( "^the element on index '(\\d+?)' has '(.+?)' as '(.+?)'$" ) public void assertSeleniumHasAttributeValue ( Integer index , String attribute , String value ) { } }
assertThat ( this . commonspec , commonspec . getPreviousWebElements ( ) ) . as ( "There are less found elements than required" ) . hasAtLeast ( index ) ; String val = commonspec . getPreviousWebElements ( ) . getPreviousWebElements ( ) . get ( index ) . getAttribute ( attribute ) ; assertThat ( this . commonspec , val ) . as ( "Attribute not found" ) . isNotNull ( ) ; assertThat ( this . commonspec , val ) . as ( "Unexpected value for specified attribute" ) . matches ( value ) ;
public class Logger { /** * Writes the given text to the output file . * @ param text * log message */ private synchronized void log ( final String text ) { } }
try { this . writer . write ( text ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; }
public class AuditManager { /** * Gets the audit thread context that is unique per thread . * If / when a common thread storage framework is supplied , then this method * implementation may need to be updated to take it into consideration . * @ return the subject thread context . */ @ Trivial protected AuditThreadContext getAuditThreadContext ( ) { } }
ThreadLocal < AuditThreadContext > currentThreadLocal = getThreadLocal ( ) ; AuditThreadContext auditThreadContext = currentThreadLocal . get ( ) ; if ( auditThreadContext == null ) { auditThreadContext = new AuditThreadContext ( ) ; currentThreadLocal . set ( auditThreadContext ) ; } return auditThreadContext ;
public class SchedulerForType { /** * Find a matching pair of node , request by looping through the requests in * the session , looking at the hosts in each request and making look - ups * into the node manager . * @ param session The session * @ param level The locality level at which we are trying to schedule . * @ return A match if found , null if not . */ private MatchedPair matchNodeForSession ( Session session , LocalityLevel level ) { } }
Iterator < ResourceRequestInfo > pendingRequestIterator = session . getPendingRequestIteratorForType ( type ) ; while ( pendingRequestIterator . hasNext ( ) ) { ResourceRequestInfo req = pendingRequestIterator . next ( ) ; Set < String > excluded = req . getExcludeHosts ( ) ; if ( req . getHosts ( ) == null || req . getHosts ( ) . size ( ) == 0 ) { // No locality requirement String host = null ; ClusterNode node = nodeManager . getRunnableNode ( host , LocalityLevel . ANY , type , excluded ) ; if ( node != null ) { return new MatchedPair ( node , req ) ; } continue ; } for ( RequestedNode requestedNode : req . getRequestedNodes ( ) ) { ClusterNode node = nodeManager . getRunnableNode ( requestedNode , level , type , excluded ) ; if ( node != null ) { return new MatchedPair ( node , req ) ; } } } return null ;
public class PageFlowUtils { /** * Get the shared flow with the given class name . * @ param sharedFlowClassName the class name of the shared flow to retrieve . * @ param request the current HttpServletRequest . * @ return the { @ link SharedFlowController } of the given class name which is stored in the user session . */ public static SharedFlowController getSharedFlow ( String sharedFlowClassName , HttpServletRequest request , ServletContext servletContext ) { } }
StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attrName = ScopedServletUtils . getScopedSessionAttrName ( InternalConstants . SHARED_FLOW_ATTR_PREFIX + sharedFlowClassName , request ) ; SharedFlowController sf = ( SharedFlowController ) sh . getAttribute ( rc , attrName ) ; if ( sf != null ) { sf . reinitializeIfNecessary ( request , null , servletContext ) ; } return sf ;
public class JandexApplicationHelper { /** * Method to create jars , wars and ears for testing . Resources are created * as needed and added to dropins or apps directories as specified . */ private static void addEarToServer ( LibertyServer server , String dir , String earName , boolean addEarResources , String warName , boolean addWarResources , String jarName , boolean addJarResources , String ... packageNames ) throws Exception { } }
if ( warName == null ) return ; // If server is already started and app exists no need to add it . if ( server . isStarted ( ) ) { String appName = warName . substring ( 0 , warName . indexOf ( ".war" ) ) ; Set < String > appInstalled = server . getInstalledAppNames ( appName ) ; LOG . info ( "addEarToServer : " + appName + " already installed : " + ! appInstalled . isEmpty ( ) ) ; if ( ! appInstalled . isEmpty ( ) ) return ; } JavaArchive jar = null ; WebArchive war = null ; if ( jarName != null ) { LOG . info ( "addEarToServer : create jar " + jarName + ", jar includes resources : " + addJarResources ) ; jar = ShrinkWrap . create ( JavaArchive . class , jarName ) ; if ( packageNames != null ) { for ( String packageName : packageNames ) { if ( packageName . contains ( ".jar." ) ) { jar . addPackage ( packageName ) ; } } } if ( addJarResources ) ShrinkHelper . addDirectory ( jar , "test-applications/" + jarName + "/resources" ) ; } war = ShrinkWrap . create ( WebArchive . class , warName ) ; LOG . info ( "addEarToServer : create war " + warName + ", war includes resources : " + addWarResources ) ; if ( packageNames != null ) { for ( String packageName : packageNames ) { if ( packageName . contains ( ".war." ) ) { war . addPackage ( packageName ) ; } } } if ( jar != null ) war . addAsLibrary ( jar ) ; if ( addWarResources ) ShrinkHelper . addDirectory ( war , "test-applications/" + warName + "/resources" ) ; if ( earName != null ) { LOG . info ( "addEarToServer : crteate ear " + earName + ", ear include application/.xml : " + addEarResources ) ; EnterpriseArchive ear = ShrinkWrap . create ( EnterpriseArchive . class , earName ) ; ear . addAsModule ( war ) ; if ( addEarResources ) ear . addAsManifestResource ( new File ( "test-applications/" + earName + "/resources/META-INF/application.xml" ) ) ; // Liberty does not use was . policy but permissions . xml File permissionsXML = new File ( "test-applications/" + earName + "/resources/META-INF/permissions.xml" ) ; if ( permissionsXML . exists ( ) ) { ear . addAsManifestResource ( permissionsXML ) ; } ShrinkHelper . exportToServer ( server , dir , ear ) ; } else { ShrinkHelper . exportToServer ( server , dir , war ) ; }
public class RingBufferBuilder { /** * Create a builder for ring buffers that use the supplied { @ link Executor } to create threads for each { @ link Consumer } * instance . The ring buffer will allow entries to be added from multiple threads . * @ param executor the executor that should be used to create threads to run { @ link Consumer } s ; may not be null * @ param entryClass the type of entry that will be put into and consumed from the buffer ; may not be null * @ return the builder for ring buffers ; never null */ public static < T , C extends Consumer < T > > RingBufferBuilder < T , C > withMultipleProducers ( Executor executor , Class < T > entryClass ) { } }
return new RingBufferBuilder < > ( executor , StandardConsumerAdapter . < T , C > create ( ) ) . multipleProducers ( ) ;
public class CmsMessageBundleEditorOptions { /** * Sets the path of the edited file in the corresponding display . * @ param editedFilePath path of the edited file to set . */ public void setEditedFilePath ( final String editedFilePath ) { } }
m_filePathField . setReadOnly ( false ) ; m_filePathField . setValue ( editedFilePath ) ; m_filePathField . setReadOnly ( true ) ;
public class NavigationAnimationFactory { /** * Create a new zoom in { @ link NavigationAnimation } that zooms in one resolution , to the requested position . * @ param mapPresenter The map onto which you want the zoom in animation to run . * @ param position The position to arrive at . * @ return The animation . Just call " run " to have it animate the map . */ public static NavigationAnimation createZoomIn ( MapPresenter mapPresenter , Coordinate position ) { } }
View endView = null ; int index = mapPresenter . getViewPort ( ) . getResolutionIndex ( mapPresenter . getViewPort ( ) . getResolution ( ) ) ; if ( index < mapPresenter . getViewPort ( ) . getResolutionCount ( ) - 1 ) { endView = new View ( position , mapPresenter . getViewPort ( ) . getResolution ( index + 1 ) ) ; } else { endView = new View ( position , mapPresenter . getViewPort ( ) . getResolution ( ) ) ; } return new NavigationAnimationImpl ( mapPresenter . getViewPort ( ) , mapPresenter . getEventBus ( ) , new LinearTrajectory ( mapPresenter . getViewPort ( ) . getView ( ) , endView ) , getMillis ( mapPresenter ) ) ;
public class InputStreamProvider { /** * open the file and read the magic number from the beginning * this is used to determine the compression type * @ param in an input stream to read from * @ return the magic number * @ throws IOException */ private int getMagicNumber ( InputStream in ) throws IOException { } }
int t = in . read ( ) ; if ( t < 0 ) throw new EOFException ( "Failed to read magic number" ) ; int magic = ( t & 0xff ) << 8 ; t = in . read ( ) ; if ( t < 0 ) throw new EOFException ( "Failed to read magic number" ) ; magic += t & 0xff ; return magic ;
public class WhereCondition { /** * Add columnName into WHERE clause * @ param columnName * @ return */ public WhereCondition Col ( String columnName ) { } }
mSgSQL . append ( columnName ) ; checkTokenOrderIsCorrect ( ESqlToken . COLUMN ) ; return WhereCondition . this ;
public class ApiOvhDbaaslogs { /** * Returns details of specified graylog stream alert * REST : GET / dbaas / logs / { serviceName } / output / graylog / stream / { streamId } / alert / { alertId } * @ param serviceName [ required ] Service name * @ param streamId [ required ] Stream ID * @ param alertId [ required ] Alert ID */ public OvhStreamAlertCondition serviceName_output_graylog_stream_streamId_alert_alertId_GET ( String serviceName , String streamId , String alertId ) throws IOException { } }
String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/alert/{alertId}" ; StringBuilder sb = path ( qPath , serviceName , streamId , alertId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhStreamAlertCondition . class ) ;
public class ClassWriter { public MethodWriter visitMethod ( final int access , final String name , final String desc , final String [ ] exceptions ) { } }
MethodWriter cw = new MethodWriter ( this , access , name , desc , exceptions ) ; this . methods . add ( cw ) ; return cw ;
public class ExternalChildResourceImpl { /** * Add a dependency task group for this model . * @ param dependency the dependency . * @ return key to be used as parameter to taskResult ( string ) method to retrieve result of root * task in the given dependency task group */ protected String addDependency ( TaskGroup . HasTaskGroup dependency ) { } }
Objects . requireNonNull ( dependency ) ; this . taskGroup ( ) . addDependencyTaskGroup ( dependency . taskGroup ( ) ) ; return dependency . taskGroup ( ) . key ( ) ;
public class DateFormat { /** * Creates a { @ link DateFormat } object that can be used to format dates in * the calendar system specified by < code > cal < / code > . * @ param cal The calendar system for which a date format is desired . * @ param dateStyle The type of date format desired . This can be * { @ link DateFormat # SHORT } , { @ link DateFormat # MEDIUM } , * etc . * @ param locale The locale for which the date format is desired . */ static final public DateFormat getDateInstance ( Calendar cal , int dateStyle , Locale locale ) { } }
return getDateTimeInstance ( cal , dateStyle , - 1 , ULocale . forLocale ( locale ) ) ;
public class AmazonDynamoDBClient { /** * < code > TransactWriteItems < / code > is a synchronous write operation that groups up to 10 action requests . These * actions can target items in different tables , but not in different AWS accounts or regions , and no two actions * can target the same item . For example , you cannot both < code > ConditionCheck < / code > and < code > Update < / code > the * same item . * The actions are completed atomically so that either all of them succeed , or all of them fail . They are defined by * the following objects : * < ul > * < li > * < code > Put < / code > & # x97 ; Initiates a < code > PutItem < / code > operation to write a new item . This structure * specifies the primary key of the item to be written , the name of the table to write it in , an optional condition * expression that must be satisfied for the write to succeed , a list of the item ' s attributes , and a field * indicating whether or not to retrieve the item ' s attributes if the condition is not met . * < / li > * < li > * < code > Update < / code > & # x97 ; Initiates an < code > UpdateItem < / code > operation to update an existing item . This * structure specifies the primary key of the item to be updated , the name of the table where it resides , an * optional condition expression that must be satisfied for the update to succeed , an expression that defines one or * more attributes to be updated , and a field indicating whether or not to retrieve the item ' s attributes if the * condition is not met . * < / li > * < li > * < code > Delete < / code > & # x97 ; Initiates a < code > DeleteItem < / code > operation to delete an existing item . This * structure specifies the primary key of the item to be deleted , the name of the table where it resides , an * optional condition expression that must be satisfied for the deletion to succeed , and a field indicating whether * or not to retrieve the item ' s attributes if the condition is not met . * < / li > * < li > * < code > ConditionCheck < / code > & # x97 ; Applies a condition to an item that is not being modified by the * transaction . This structure specifies the primary key of the item to be checked , the name of the table where it * resides , a condition expression that must be satisfied for the transaction to succeed , and a field indicating * whether or not to retrieve the item ' s attributes if the condition is not met . * < / li > * < / ul > * DynamoDB rejects the entire < code > TransactWriteItems < / code > request if any of the following is true : * < ul > * < li > * A condition in one of the condition expressions is not met . * < / li > * < li > * A conflicting operation is in the process of updating the same item . * < / li > * < li > * There is insufficient provisioned capacity for the transaction to be completed . * < / li > * < li > * An item size becomes too large ( bigger than 400 KB ) , a Local Secondary Index ( LSI ) becomes too large , or a * similar validation error occurs because of changes made by the transaction . * < / li > * < li > * There is a user error , such as an invalid data format . * < / li > * < / ul > * @ param transactWriteItemsRequest * @ return Result of the TransactWriteItems operation returned by the service . * @ throws ResourceNotFoundException * The operation tried to access a nonexistent table or index . The resource might not be specified * correctly , or its status might not be < code > ACTIVE < / code > . * @ throws TransactionCanceledException * The entire transaction request was rejected . < / p > * DynamoDB rejects a < code > TransactWriteItems < / code > request under the following circumstances : * < ul > * < li > * A condition in one of the condition expressions is not met . * < / li > * < li > * A table in the < code > TransactWriteItems < / code > request is in a different account or region . * < / li > * < li > * More than one action in the < code > TransactWriteItems < / code > operation targets the same item . * < / li > * < li > * There is insufficient provisioned capacity for the transaction to be completed . * < / li > * < li > * An item size becomes too large ( larger than 400 KB ) , or a local secondary index ( LSI ) becomes too large , * or a similar validation error occurs because of changes made by the transaction . * < / li > * < li > * There is a user error , such as an invalid data format . * < / li > * < / ul > * DynamoDB rejects a < code > TransactGetItems < / code > request under the following circumstances : * < ul > * < li > * There is an ongoing < code > TransactGetItems < / code > operation that conflicts with a concurrent * < code > PutItem < / code > , < code > UpdateItem < / code > , < code > DeleteItem < / code > or < code > TransactWriteItems < / code > * request . In this case the < code > TransactGetItems < / code > operation fails with a * < code > TransactionCanceledException < / code > . * < / li > * < li > * A table in the < code > TransactGetItems < / code > request is in a different account or region . * < / li > * < li > * There is insufficient provisioned capacity for the transaction to be completed . * < / li > * < li > * There is a user error , such as an invalid data format . * < / li > * @ throws TransactionInProgressException * The transaction with the given request token is already in progress . * @ throws IdempotentParameterMismatchException * DynamoDB rejected the request because you retried a request with a different payload but with an * idempotent token that was already used . * @ throws ProvisionedThroughputExceededException * Your request rate is too high . The AWS SDKs for DynamoDB automatically retry requests that receive this * exception . Your request is eventually successful , unless your retry queue is too large to finish . Reduce * the frequency of requests and use exponential backoff . For more information , go to < a href = * " https : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Programming . Errors . html # Programming . Errors . RetryAndBackoff " * > Error Retries and Exponential Backoff < / a > in the < i > Amazon DynamoDB Developer Guide < / i > . * @ throws InternalServerErrorException * An error occurred on the server side . * @ sample AmazonDynamoDB . TransactWriteItems * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dynamodb - 2012-08-10 / TransactWriteItems " target = " _ top " > AWS * API Documentation < / a > */ @ Override public TransactWriteItemsResult transactWriteItems ( TransactWriteItemsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeTransactWriteItems ( request ) ;
public class FluentCondition { /** * Create a logical AND operator between current condition and conditions * provided in parameters . * For example : * < pre > * requiredClass ( " javax . mail . Transport " ) . and ( requiredClass ( " foo . Bar " ) ) ; * < / pre > * Means that the result will be true only if the result of the current * condition ( < code > requiredClass ( " javax . mail . Transport " ) < / code > ) is true * and the result provided condition ( < code > requireClass ( " foo . Bar " ) < / code > ) * is true . * If one of the condition result is false , then other conditions are not * evaluated . * @ param conditions * one or several conditions * @ return the fluent condition */ @ SafeVarargs public final FluentCondition < T > and ( Condition < T > ... conditions ) { } }
List < Condition < T > > merged = new ArrayList < > ( ) ; merged . add ( delegate ) ; for ( Condition < T > condition : conditions ) { merged . add ( condition ) ; } return Conditions . and ( merged ) ;
public class MessageToClientManager { /** * Create a MessageToClient from MessageFromClient for session Only for available test use case * @ param message * @ param session * @ return */ MessageToClient _createMessageToClient ( MessageFromClient message , T session ) { } }
MessageToClient messageToClient = new MessageToClient ( ) ; messageToClient . setId ( message . getId ( ) ) ; try { Class cls = Class . forName ( message . getDataService ( ) ) ; Object dataService = this . getDataService ( session , cls ) ; logger . debug ( "Process message {}" , message ) ; List < Object > arguments = getArrayList ( ) ; Method method = methodServices . getMethodFromDataService ( cls , message , arguments ) ; injectSession ( method . getParameterTypes ( ) , arguments , session ) ; messageToClient . setResult ( method . invoke ( dataService , arguments . toArray ( ) ) ) ; if ( method . isAnnotationPresent ( JsonMarshaller . class ) ) { messageToClient . setJson ( argumentServices . getJsonResultFromSpecificMarshaller ( method . getAnnotation ( JsonMarshaller . class ) , messageToClient . getResponse ( ) ) ) ; } try { Method nonProxiedMethod = methodServices . getNonProxiedMethod ( cls , method . getName ( ) , method . getParameterTypes ( ) ) ; messageToClient . setDeadline ( cacheManager . processCacheAnnotations ( nonProxiedMethod , message . getParameters ( ) ) ) ; } catch ( NoSuchMethodException ex ) { logger . error ( "Fail to process extra annotations (JsCacheResult, JsCacheRemove) for method : " + method . getName ( ) , ex ) ; } logger . debug ( "Method {} proceed messageToClient : {}." , method . getName ( ) , messageToClient ) ; } catch ( InvocationTargetException ex ) { Throwable cause = ex . getCause ( ) ; if ( ConstraintViolationException . class . isInstance ( cause ) ) { messageToClient . setConstraints ( constraintServices . extractViolations ( ( ConstraintViolationException ) cause ) ) ; } else { messageToClient . setFault ( faultServices . buildFault ( cause ) ) ; } } catch ( Throwable ex ) { messageToClient . setFault ( faultServices . buildFault ( ex ) ) ; } return messageToClient ;
public class EMFGeneratorFragment { /** * Create a clone of the original grammar . The clone will not refer to a node model . */ private Grammar cloneGrammarIntoNewResourceSet ( Grammar original ) { } }
Resource originalResource = original . eResource ( ) ; ResourceSet clonedResourceSet = EcoreUtil2 . clone ( new XtextResourceSet ( ) , originalResource . getResourceSet ( ) ) ; Resource clonedResource = clonedResourceSet . getResource ( originalResource . getURI ( ) , false ) ; Grammar clonedGrammar = ( Grammar ) clonedResource . getContents ( ) . get ( 0 ) ; return clonedGrammar ;
public class ResponseTypeNormalizer { /** * Normalizes the body type ( e . g . removes nested { @ link GenericEntity } s ) . * @ param type The type * @ return The normalized type */ static String normalizeResponseWrapper ( final String type ) { } }
if ( ! getTypeParameters ( type ) . isEmpty ( ) && isAssignableTo ( type , Types . GENERIC_ENTITY ) ) return getTypeParameters ( type ) . get ( 0 ) ; return type ;