Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369539 - DBWS: Need to remove instanceof checks in the design time code
Summary: DBWS: Need to remove instanceof checks in the design time code
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 10:55 EST by David McCann CLA
Modified: 2022-06-09 10:23 EDT (History)
2 users (show)

See Also:


Attachments
DBWS Builder changes (46.51 KB, patch)
2012-02-22 14:58 EST, David McCann CLA
no flags Details | Diff
DDL Parser changes (56.28 KB, patch)
2012-02-22 15:00 EST, David McCann CLA
no flags Details | Diff
clean instanceof checks (121.54 KB, patch)
2012-02-23 17:36 EST, Mike Norman CLA
no flags Details | Diff
clean instanceof checks (2) (40.83 KB, patch)
2012-02-23 17:37 EST, Mike Norman CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2012-01-24 10:55:36 EST
We should add boolean methods to org.eclipse.persistence.tools.oracleddl.metadata.CompositeDatabaseTypeBase that indicate ObjectType, VArrayType, etc. such that we can avoid the numerous instancof checks throughout the code.
Comment 1 David McCann CLA 2012-02-22 14:58:35 EST
Created attachment 211445 [details]
DBWS Builder changes

Makes use of the new isXXX methods to reduce the number of 'instanceof' checks.
Comment 2 David McCann CLA 2012-02-22 15:00:54 EST
Created attachment 211446 [details]
DDL Parser changes

Added isXXX methods to CompositeDatabaseType (class & interface) for each composite database type.

In addition, isXXX methods were added to ScalarDatabaseType (class and interface) for all of the scalar types.

The number of 'instanceof' checks in the builder package is reduced by 85 (104 down to 19).
Comment 3 David McCann CLA 2012-02-22 15:04:00 EST
There were also a number of small changes where 'instanceof' checks were being performed unnecessarily.
Comment 4 Mike Norman CLA 2012-02-23 17:36:31 EST
Created attachment 211542 [details]
clean instanceof checks

alternate version of previous patch
Comment 5 Mike Norman CLA 2012-02-23 17:37:10 EST
Created attachment 211543 [details]
clean instanceof checks (2)

alternate version of previous patch
Comment 6 Mike Norman CLA 2012-02-24 14:10:23 EST
fixed in Oracle DDL Parser (git) and in DBWSBuilder (svn)
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:23:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink